diff --git a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m index 18576ec..22be088 100644 --- a/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m +++ b/MVMCore/MVMCore/LoadHandling/MVMCoreLoadRequestOperation.m @@ -845,9 +845,28 @@ } else { [MVMCoreLoggingHandler logWithDelegateLoadFinished:loadObject loadedViewController:loadedViewController error:errorObject]; } + + //make post load calls function + [MVMCoreLoadRequestOperation loadPostCallActions:loadObject]; + [loadObject.operation markAsFinished]; } + ++ (void)loadPostCallActions:(nonnull MVMCoreLoadObject *)loadObject { + NSDictionary *postCallsDict = [loadObject.pageJSON dictionaryForKey:@"postLoadActions"]; + if (postCallsDict.count > 0) { + NSArray *actionList = [postCallsDict arrayForKey:@"actionList"]; + BOOL isConcurrent = [postCallsDict boolForKey:@"concurrent"]; + //Needs further enhancements based on the flags. + if (isConcurrent) { + [actionList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [[MVMCoreActionHandler sharedActionHandler] handleActionWithDictionary:obj additionalData:nil delegateObject:nil]; + }]; + } + } +} + #pragma mark - Presentation Delegate - (void)navigationController:(UINavigationController *)navigationController willDisplayViewController:(UIViewController *)viewController {