Merge branch 'develop' into feature/text_view_atom
This commit is contained in:
commit
be61cba8e8
@ -92,12 +92,8 @@ import UIKit
|
|||||||
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||||
self.handleNewDataAndUpdateUI()
|
self.handleNewDataAndUpdateUI()
|
||||||
// If the screen is showing, can update the navigation controller.
|
// If the screen is showing, can update the navigation controller.
|
||||||
if let navigationController = self.manager?.navigationController,
|
if MVMCoreUIUtility.getCurrentVisibleController() == self.manager ?? self {
|
||||||
self.manager!.getCurrentViewController() == self {
|
self.setNavigationController()
|
||||||
self.set(navigationController: navigationController)
|
|
||||||
} else if let navigationController = self.navigationController,
|
|
||||||
self == MVMCoreUIUtility.getCurrentVisibleController() {
|
|
||||||
self.set(navigationController: navigationController)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch {
|
} catch {
|
||||||
@ -177,18 +173,19 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Navigation Item (Move to model base)
|
// MARK: - Navigation Item (Move to model base)
|
||||||
open func set(navigationController: UINavigationController?) {
|
open func setNavigationController() {
|
||||||
guard let navigationItemModel = pageModel?.navigationItem,
|
guard let navigationItemModel = pageModel?.navigationItem,
|
||||||
let navigationController = navigationController else {
|
let navigationController = manager?.navigationController ?? navigationController else {
|
||||||
MVMCoreUISession.sharedGlobal()?.splitViewController?.parent?.setNeedsStatusBarAppearanceUpdate()
|
MVMCoreUISession.sharedGlobal()?.splitViewController?.parent?.setNeedsStatusBarAppearanceUpdate()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let viewController = manager ?? self
|
||||||
if navigationController == MVMCoreUISplitViewController.main()?.navigationController,
|
if navigationController == MVMCoreUISplitViewController.main()?.navigationController,
|
||||||
navigationController.topViewController == self {
|
navigationController.topViewController == viewController {
|
||||||
MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels()
|
MVMCoreUISession.sharedGlobal()?.splitViewController?.setupPanels()
|
||||||
showBottomProgressBar()
|
showBottomProgressBar()
|
||||||
}
|
}
|
||||||
NavigationController.set(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: self)
|
NavigationController.set(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Eventually will be moved to server
|
// Eventually will be moved to server
|
||||||
@ -294,10 +291,8 @@ import UIKit
|
|||||||
open override func viewWillAppear(_ animated: Bool) {
|
open override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
|
|
||||||
// Update the navigation bar ui when view is appearing unless in a manager. The manager is expected to handle.
|
// Update the navigation bar ui when view is appearing
|
||||||
if manager == nil {
|
setNavigationController()
|
||||||
set(navigationController: navigationController)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func viewDidAppear(_ animated: Bool) {
|
open override func viewDidAppear(_ animated: Bool) {
|
||||||
@ -330,9 +325,6 @@ import UIKit
|
|||||||
|
|
||||||
// MARK: - MVMCoreViewManagerViewControllerProtocol
|
// MARK: - MVMCoreViewManagerViewControllerProtocol
|
||||||
open func viewControllerReady(inManager manager: UIViewController & MVMCoreViewManagerProtocol) {
|
open func viewControllerReady(inManager manager: UIViewController & MVMCoreViewManagerProtocol) {
|
||||||
if initialLoadFinished {
|
|
||||||
set(navigationController: manager.navigationController)
|
|
||||||
}
|
|
||||||
// Janky way to track current page.
|
// Janky way to track current page.
|
||||||
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
||||||
MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
+ (nonnull UIColor *)mvmOrange;
|
+ (nonnull UIColor *)mvmOrange;
|
||||||
+ (nonnull UIColor *)mfPumpkinColor;
|
+ (nonnull UIColor *)mfPumpkinColor;
|
||||||
+ (nonnull UIColor *)mfShamrock;
|
+ (nonnull UIColor *)mfShamrock;
|
||||||
|
+ (nonnull UIColor *)mvmGreen;
|
||||||
+ (nonnull UIColor *)mfCerulean;
|
+ (nonnull UIColor *)mfCerulean;
|
||||||
+ (nonnull UIColor *)mfWhiteTwo;
|
+ (nonnull UIColor *)mfWhiteTwo;
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,10 @@
|
|||||||
return [UIColor mfColor8bitsWithRed:0 green:134 blue:49 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:0 green:134 blue:49 alpha:1.0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (nonnull UIColor *)mvmGreen {
|
||||||
|
return [UIColor mfColor8bitsWithRed:0 green:134 blue:48 alpha:1.0];
|
||||||
|
}
|
||||||
|
|
||||||
+ (nonnull UIColor *)mfCerulean {
|
+ (nonnull UIColor *)mfCerulean {
|
||||||
return [UIColor mfColor8bitsWithRed:0 green:122 blue:184 alpha:1.0];
|
return [UIColor mfColor8bitsWithRed:0 green:122 blue:184 alpha:1.0];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ import UIKit
|
|||||||
return navigationController
|
return navigationController
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func set(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: (UIViewController & MVMCoreViewControllerProtocol)) {
|
public static func set(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol, viewController: UIViewController) {
|
||||||
viewController.navigationItem.title = navigationItemModel.title
|
viewController.navigationItem.title = navigationItemModel.title
|
||||||
viewController.navigationItem.accessibilityLabel = navigationItemModel.title
|
viewController.navigationItem.accessibilityLabel = navigationItemModel.title
|
||||||
viewController.navigationItem.hidesBackButton = !navigationItemModel.systemBackButton
|
viewController.navigationItem.hidesBackButton = !navigationItemModel.systemBackButton
|
||||||
@ -58,7 +58,7 @@ import UIKit
|
|||||||
if navigationController == MVMCoreUISession.sharedGlobal()?.navigationController,
|
if navigationController == MVMCoreUISession.sharedGlobal()?.navigationController,
|
||||||
navigationController.topViewController == viewController {
|
navigationController.topViewController == viewController {
|
||||||
// Update line.
|
// Update line.
|
||||||
MVMCoreUISession.sharedGlobal()?.navigationController?.separatorView?.set(with: navigationItemModel.line ?? LineModel(type: .standard), viewController.delegateObject?() as? MVMCoreUIDelegateObject, nil)
|
MVMCoreUISession.sharedGlobal()?.navigationController?.separatorView?.setStyle(navigationItemModel.line?.type ?? .standard)
|
||||||
}
|
}
|
||||||
|
|
||||||
if navigationController == MVMCoreUISplitViewController.main()?.navigationController,
|
if navigationController == MVMCoreUISplitViewController.main()?.navigationController,
|
||||||
|
|||||||
@ -153,11 +153,11 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
- (IBAction)leftPanelButtonPressed:(id)sender {
|
- (IBAction)leftPanelButtonPressed:(id)sender {
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
UIViewController *viewController = self.navigationController.topViewController;
|
UIViewController *viewController = self.navigationController.topViewController;
|
||||||
|
UIViewController *detailViewController = [self getCurrentDetailViewController];
|
||||||
// If Viewcontroller confirms to protocol and implements the the method leftPanelButtonPressed
|
// If Viewcontroller confirms to protocol and implements the the method leftPanelButtonPressed
|
||||||
if ([viewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)]
|
if ([detailViewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)]
|
||||||
&& [viewController respondsToSelector:@selector(isOverridingLeftButton)]
|
&& [detailViewController respondsToSelector:@selector(isOverridingLeftButton)]
|
||||||
&& [((UIViewController <MVMCoreUIDetailViewProtocol> *)viewController) isOverridingLeftButton]) {
|
&& [((UIViewController <MVMCoreUIDetailViewProtocol> *)detailViewController) isOverridingLeftButton]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,9 +175,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
- (IBAction)backButtonPressed:(id)sender {
|
- (IBAction)backButtonPressed:(id)sender {
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
UIViewController *viewController = self.navigationController.topViewController;
|
UIViewController *detailViewController = [self getCurrentDetailViewController];
|
||||||
if ([viewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)] && [viewController respondsToSelector:@selector(backButtonPressed)]) {
|
if ([detailViewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)] && [detailViewController respondsToSelector:@selector(backButtonPressed)]) {
|
||||||
[((UIViewController <MVMCoreUIDetailViewProtocol> *)viewController) backButtonPressed];
|
[((UIViewController <MVMCoreUIDetailViewProtocol> *)detailViewController) backButtonPressed];
|
||||||
} else {
|
} else {
|
||||||
[[MVMCoreNavigationHandler sharedNavigationHandler] popTopViewControllerAnimated:YES];
|
[[MVMCoreNavigationHandler sharedNavigationHandler] popTopViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
@ -187,11 +187,12 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
- (IBAction)rightPanelButtonPressed:(id)sender {
|
- (IBAction)rightPanelButtonPressed:(id)sender {
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
UIViewController *viewController = self.navigationController.topViewController;
|
UIViewController *viewController = self.navigationController.topViewController;
|
||||||
|
UIViewController *detailViewController = [self getCurrentDetailViewController];
|
||||||
|
|
||||||
// If Viewcontroller confirms to protocol and implements the the method rightPanelButtonPressed
|
// If Viewcontroller confirms to protocol and implements the the method rightPanelButtonPressed
|
||||||
if ([viewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)]
|
if ([detailViewController conformsToProtocol:@protocol(MVMCoreUIDetailViewProtocol)]
|
||||||
&& [viewController respondsToSelector:@selector(isOverridingRightButton)]
|
&& [detailViewController respondsToSelector:@selector(isOverridingRightButton)]
|
||||||
&& [((UIViewController <MVMCoreUIDetailViewProtocol> *)viewController) isOverridingRightButton]) {
|
&& [((UIViewController <MVMCoreUIDetailViewProtocol> *)detailViewController) isOverridingRightButton]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user