diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.h b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.h index 13df1fa..2810b3c 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.h +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.h @@ -26,7 +26,7 @@ @property (nullable, weak, nonatomic) UINavigationController *navigationController; /// A list of possible delegates looking for information. -@property (nonnull, strong, nonatomic) NSHashTable *delegates; +@property (nonnull, strong, nonatomic) NSHashTable *delegates; // Will navigate appropriately based on the load style - (void)navigateWithLoadObject:(nullable MVMCoreLoadObject *)loadObject viewController:(nonnull UIViewController *)viewController delegate:(nullable NSObject*)delegate completionHandler:(nullable void (^)(void))completionBlock; diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m index 107f03f..5849d9f 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m @@ -60,11 +60,7 @@ } - (void)removeDelegate:(nullable id )delegate { - for (id currentDelegate in [self.delegates allObjects]) { - if (currentDelegate == delegate) { - [self.delegates removeObject:delegate]; - } - } + [self.delegates removeObject:delegate]; } #pragma mark - Navigation Helpers diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m index 999e5d2..bdd32eb 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationOperation.m @@ -237,7 +237,7 @@ if (self.delegate && [self.delegate respondsToSelector:@selector(navigationController:willDisplayViewController:)]) { [self.delegate navigationController:navigationController willDisplayViewController:viewController]; } - for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { + for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { if (delegate && [delegate respondsToSelector:@selector(navigationController:willDisplayViewController:)]) { [delegate navigationController:navigationController willDisplayViewController:viewController]; } @@ -249,7 +249,7 @@ if (self.delegate && [self.delegate respondsToSelector:@selector(navigationController:displayedViewController:)]) { [self.delegate navigationController:navigationController displayedViewController:viewController]; } - for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { + for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { if (delegate && [delegate respondsToSelector:@selector(navigationController:displayedViewController:)]) { [delegate navigationController:navigationController displayedViewController:viewController]; } diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentAnimationOperation.m b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentAnimationOperation.m index 85c533f..206dd95 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentAnimationOperation.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentAnimationOperation.m @@ -40,7 +40,7 @@ if (self.delegate && [self.delegate respondsToSelector:@selector(viewController:willPresentViewController:)]) { [self.delegate viewController:self.presentingViewController willPresentViewController:self.presentedViewController]; } - for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { + for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { if (delegate && [delegate respondsToSelector:@selector(viewController:willPresentViewController:)]) { [delegate viewController:self.presentingViewController willPresentViewController:self.presentedViewController]; } @@ -51,7 +51,7 @@ if (self.delegate && [self.delegate respondsToSelector:@selector(viewController:didPresentViewController:)]) { [self.delegate viewController:self.presentingViewController didPresentViewController:self.presentedViewController]; } - for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { + for (NSObject *delegate in [MVMCoreNavigationHandler sharedNavigationHandler].delegates.allObjects) { if (delegate && [delegate respondsToSelector:@selector(viewController:didPresentViewController:)]) { [delegate viewController:self.presentingViewController didPresentViewController:self.presentedViewController]; } diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentationDelegateProtocol.h b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentationDelegateProtocol.h index 6acf505..8dc27f4 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCorePresentationDelegateProtocol.h +++ b/MVMCore/MVMCore/PresentationHandling/MVMCorePresentationDelegateProtocol.h @@ -37,10 +37,4 @@ // Called when a view controller did be present on another - (void)viewController:(nonnull UIViewController *)presentingViewController didPresentViewController:(nonnull UIViewController *)presentedViewController; -// Called when a view controller will be dismissed off another view controller -- (void)willDismissViewController:(nonnull UIViewController *)viewController; - -// Called when a view controller did dismiss -- (void)didDismissViewController:(nonnull UIViewController *)viewController; - @end