From 78654b689d33e101031349e7f4fa0935160686d8 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Tue, 3 Mar 2020 15:08:24 -0500 Subject: [PATCH] Cleaning --- MVMCore/MVMCore/Constants/MVMCoreConstants.h | 1 + MVMCore/MVMCore/Constants/MVMCoreConstants.m | 1 + .../MVMCoreDismissViewControllerOperation.m | 5 +++++ .../PresentationHandling/MVMCoreNavigationOperation.m | 4 ++++ .../MVMCorePresentViewControllerOperation.m | 5 +++++ 5 files changed, 16 insertions(+) diff --git a/MVMCore/MVMCore/Constants/MVMCoreConstants.h b/MVMCore/MVMCore/Constants/MVMCoreConstants.h index e4ac6be..e653ffe 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreConstants.h +++ b/MVMCore/MVMCore/Constants/MVMCoreConstants.h @@ -42,6 +42,7 @@ extern NSString * const URLComponentKeepAlive; extern NSString * const NotificationResponseLoaded; extern NSString * const MVMCoreNotificationGoingToServer; +extern NSString * const MVMCoreNotificationViewControllerChanged; #pragma mark - Image Cache extern NSTimeInterval const ImageTimeOut; diff --git a/MVMCore/MVMCore/Constants/MVMCoreConstants.m b/MVMCore/MVMCore/Constants/MVMCoreConstants.m index cf0761f..887ee0c 100644 --- a/MVMCore/MVMCore/Constants/MVMCoreConstants.m +++ b/MVMCore/MVMCore/Constants/MVMCoreConstants.m @@ -29,6 +29,7 @@ NSString * const URLComponentKeepAlive = @"isAlive.jsp"; NSString * const NotificationResponseLoaded = @"responseLoaded"; NSString * const MVMCoreNotificationGoingToServer = @"MVMCoreGoServer"; +NSString * const MVMCoreNotificationViewControllerChanged = @"MVMCoreNotificationViewControllerChanged"; #pragma mark - Image Cache NSTimeInterval const ImageTimeOut = 60; diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreDismissViewControllerOperation.m b/MVMCore/MVMCore/PresentationHandling/MVMCoreDismissViewControllerOperation.m index bd2287d..4a09cb4 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreDismissViewControllerOperation.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreDismissViewControllerOperation.m @@ -7,6 +7,7 @@ // #import "MVMCoreDismissViewControllerOperation.h" +#import "MVMCoreConstants.h" typedef NS_ENUM(NSInteger, DismissType) { DismissTypeTop = 0, @@ -77,6 +78,10 @@ typedef NS_ENUM(NSInteger, DismissType) { if (viewController.presentedViewController || viewController.presentingViewController) { [viewController dismissViewControllerAnimated:self.animate completion:^{ [self markAsFinished]; + // Notify that page has changed + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil]; + }); }]; } else { [self markAsFinished]; diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m index ee960aa..5a39b73 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m @@ -242,6 +242,10 @@ [self.delegate navigationController:navigationController displayedViewController:viewController]; } [self markAsFinished]; + // Notify that page has changed + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil]; + }); } - (nullable id )navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC { diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentViewControllerOperation.m b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentViewControllerOperation.m index 809f0cc..6b7c51b 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentViewControllerOperation.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentViewControllerOperation.m @@ -10,6 +10,7 @@ #import "MVMCoreAlertController.h" #import "MVMCorePresentAnimationOperation.h" #import "MVMCoreDispatchUtility.h" +#import "MVMCoreConstants.h" @interface MVMCorePresentViewControllerOperation () @@ -74,6 +75,10 @@ static void * XXContext = &XXContext; animationOperation.delegate = self.delegate; [animationOperation setCompletionBlock:^{ [self markAsFinished]; + // Notify that page has changed + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [[NSNotificationCenter defaultCenter] postNotificationName:MVMCoreNotificationViewControllerChanged object:nil]; + }); }]; [[NSOperationQueue mainQueue] addOperation:animationOperation]; }