Top alert queue fix

This commit is contained in:
Pfeil, Scott Robert 2018-05-07 15:48:59 -04:00
parent 060b6b3303
commit 50fb716f99
4 changed files with 11 additions and 2 deletions

View File

@ -16,6 +16,7 @@
#import "MVMCoreRequestParameters.h"
#import "MVMCoreErrorConstants.h"
#import "MVMCoreLoggingHandler.h"
#import "MVMCoreLoadingOverlayHandler.h"
@interface MVMCoreNavigationHandler ()
@ -90,6 +91,10 @@
- (void)startNavigationWithNavigationObject:(MVMCoreNavigationObject *)navigationObject delegate:(nullable NSObject<MVMCorePresentationDelegateProtocol>*)delegate completionHandler:(nullable void (^)(void))completionBlock {
// In case it takes some time to happen.
[[MVMCoreLoadingOverlayHandler sharedLoadingOverlay] startLoading];
navigationObject.stopLoadingOverlay = YES;
MVMCoreNavigationOperation *navigationOperation = [[MVMCoreNavigationOperation alloc] initWithNavigationObject:navigationObject];
navigationOperation.delegate = delegate;
navigationOperation.completionBlock = completionBlock;

View File

@ -20,6 +20,7 @@
@property (nonatomic) NavigationType navigationType;
@property (nonatomic) BOOL animated;
@property (nonatomic) BOOL tryToReplaceFirst;
@property (nonatomic) BOOL stopLoadingOverlay;
- (nullable instancetype)initWithViewController:(nullable UIViewController *)viewController navigationController:(nullable UINavigationController *)navigationController viewControllers:(nullable NSArray *)viewControllers animated:(BOOL)animated tryToReplaceFirst:(BOOL)tryToReplaceFirst navigationType:(NavigationType)navigationType;

View File

@ -11,6 +11,7 @@
#import "MVMCoreViewManagerProtocol.h"
#import "MVMCoreViewControllerProtocol.h"
#import "MVMCoreLoggingHandler.h"
#import "MVMCoreLoadingOverlayHandler.h"
@interface MVMCoreNavigationOperation ()
@ -209,7 +210,10 @@
}
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (self.navigationObject.stopLoadingOverlay) {
[[MVMCoreLoadingOverlayHandler sharedLoadingOverlay] stopLoading:YES];
}
if (self.delegate && [self.delegate respondsToSelector:@selector(navigationController:willDisplayViewController:)]) {
[self.delegate navigationController:navigationController willDisplayViewController:viewController];
}

View File

@ -22,7 +22,6 @@
return operation;
}
- (void)main {
// Always check for cancellation before launching the task.