Merge remote-tracking branch 'origin/develop' into feature/molecule_replacement_behavior
This commit is contained in:
commit
baca0d8031
@ -262,7 +262,7 @@ extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func willDisplay(_ viewController: UIViewController) {
|
public func willDisplay(_ viewController: UIViewController) {
|
||||||
setupPanels()
|
setupPanels(viewController)
|
||||||
updateState(with: viewController)
|
updateState(with: viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ typedef NS_ENUM(NSInteger, MFNumberOfDrawers) {
|
|||||||
- (void)setNavigationIconColor:(nullable UIColor *)color;
|
- (void)setNavigationIconColor:(nullable UIColor *)color;
|
||||||
|
|
||||||
/// Updates the panels that are used.
|
/// Updates the panels that are used.
|
||||||
- (void)setupPanels;
|
- (void)setupPanels:(nullable UIViewController*)viewController;
|
||||||
|
|
||||||
/// Returns if the left panel is staying extended (usually do to screen size threshold)
|
/// Returns if the left panel is staying extended (usually do to screen size threshold)
|
||||||
- (BOOL)leftPanelStaysExtended;
|
- (BOOL)leftPanelStaysExtended;
|
||||||
|
|||||||
@ -723,9 +723,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
[panel removeFromParentViewController];
|
[panel removeFromParentViewController];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setupLeftPanel {
|
- (void)setupLeftPanel:(nullable UIViewController*)viewController {
|
||||||
UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
|
UIViewController <MVMCoreUIPanelProtocol> *panel = nil;
|
||||||
UIViewController *currentViewController = [self getCurrentDetailViewController];
|
UIViewController *currentViewController = viewController ? viewController : [self getCurrentDetailViewController];
|
||||||
if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) {
|
if ([currentViewController respondsToSelector:@selector(overrideLeftPanel)]) {
|
||||||
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel];
|
panel = [((UIViewController <MVMCoreUIDetailViewProtocol> *)currentViewController) overrideLeftPanel];
|
||||||
} else {
|
} else {
|
||||||
@ -735,6 +735,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
|
|
||||||
if (!panel) {
|
if (!panel) {
|
||||||
[self removePanel:self.leftPanel];
|
[self removePanel:self.leftPanel];
|
||||||
|
self.leftPanel = nil;
|
||||||
} else if (panel && panel != self.leftPanel) {
|
} else if (panel && panel != self.leftPanel) {
|
||||||
[self removePanel:self.leftPanel];
|
[self removePanel:self.leftPanel];
|
||||||
[self addPanel:panel];
|
[self addPanel:panel];
|
||||||
@ -795,9 +796,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setupPanels {
|
- (void)setupPanels:(nullable UIViewController*)viewController {
|
||||||
[self forceHideBothDrawers];
|
[self forceHideBothDrawers];
|
||||||
[self setupLeftPanel];
|
[self setupLeftPanel:viewController];
|
||||||
[self setupRightPanel];
|
[self setupRightPanel];
|
||||||
self.explictlyShowingPanel = nil;
|
self.explictlyShowingPanel = nil;
|
||||||
[self.view layoutIfNeeded];
|
[self.view layoutIfNeeded];
|
||||||
@ -968,7 +969,7 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
[NSLayoutConstraint constraintWithItem:coverView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
|
||||||
[NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:coverView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
[NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:coverView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
|
||||||
|
|
||||||
[self setupPanels];
|
[self setupPanels:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user