From eaad6469bbb0c58c9ac7bb10e91d17838b6e0dd3 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Fri, 11 Oct 2019 13:03:41 -0400 Subject: [PATCH 1/2] Move self.presentingViewController access onto the main thread. --- MVMCoreUI/BaseControllers/MFViewController.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index edbabf80..bc8208dd 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -67,11 +67,13 @@ } - (void)dismiss { - if (self.presentingViewController) { - [[MVMCoreNavigationHandler sharedNavigationHandler] dismissViewController:self animated:YES]; - } else if (self.navigationController) { - [[MVMCoreNavigationHandler sharedNavigationHandler] popViewController:self animated:YES]; - } + [MVMCoreDispatchUtility performBlockOnMainThread:^{ + if (self.presentingViewController) { + [[MVMCoreNavigationHandler sharedNavigationHandler] dismissViewController:self animated:YES]; + } else if (self.navigationController) { + [[MVMCoreNavigationHandler sharedNavigationHandler] popViewController:self animated:YES]; + } + }]; } - (BOOL)isVisibleViewController { From a3663ee1b5f52bc40c443b394ba819329c7f66cf Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Sat, 19 Oct 2019 15:14:31 -0400 Subject: [PATCH 2/2] Add current page type to session object. --- MVMCoreUI/BaseControllers/MFViewController.m | 2 ++ MVMCoreUI/OtherHandlers/MVMCoreUISession.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/MVMCoreUI/BaseControllers/MFViewController.m b/MVMCoreUI/BaseControllers/MFViewController.m index edbabf80..5e9f3c6a 100644 --- a/MVMCoreUI/BaseControllers/MFViewController.m +++ b/MVMCoreUI/BaseControllers/MFViewController.m @@ -518,6 +518,7 @@ // Don't track page state if there is a tab bar page control, it will be handled later. if (!self.manager) { + [MVMCoreUISession sharedGlobal].currentPageType = self.pageType; [self adobeTrackPageState]; } @@ -819,6 +820,7 @@ if (self.initialLoadFinished) { [self updateNavigationBarUI:self.manager.navigationController]; } + [MVMCoreUISession sharedGlobal].currentPageType = self.pageType; [self adobeTrackPageState]; } diff --git a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h index a5ce493c..8adb32cd 100644 --- a/MVMCoreUI/OtherHandlers/MVMCoreUISession.h +++ b/MVMCoreUI/OtherHandlers/MVMCoreUISession.h @@ -22,6 +22,9 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic, nullable) MVMCoreUINavigationController *navigationController; @property (weak, nonatomic, nullable) MFLoadingViewController *loadingViewController; +/// Tracks the current page type the user is currently viewing. KVO compliant. +@property (nonatomic, strong, nullable) NSString *currentPageType; + // for handscroll Animation on subclasses of MFScrollingViewController @property (assign, nonatomic) BOOL enableHandScrollAnimation;