|
27 | 27 | @interface MEMenuViewController ()
|
28 | 28 | @property (nonatomic, strong) NSArray *menuItems;
|
29 | 29 | @property (nonatomic, strong) UINavigationController *transitionsNavigationController;
|
30 |
| -@property (nonatomic, strong) UINavigationController *settingsNavigationController; |
31 | 30 | @end
|
32 | 31 |
|
33 | 32 | @implementation MEMenuViewController
|
@@ -56,14 +55,6 @@ - (NSArray *)menuItems {
|
56 | 55 | return _menuItems;
|
57 | 56 | }
|
58 | 57 |
|
59 |
| -- (UINavigationController *)settingsNavigationController { |
60 |
| - if (_settingsNavigationController) return _settingsNavigationController; |
61 |
| - |
62 |
| - _settingsNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"MESettingsNavigationController"]; |
63 |
| - |
64 |
| - return _settingsNavigationController; |
65 |
| -} |
66 |
| - |
67 | 58 | #pragma mark - UITableViewDataSource
|
68 | 59 |
|
69 | 60 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
@@ -92,11 +83,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
|
92 | 83 | // dynamically so everything needs to start in a consistent state.
|
93 | 84 | self.slidingViewController.topViewController.view.layer.transform = CATransform3DMakeScale(1, 1, 1);
|
94 | 85 |
|
95 |
| - if ([menuItem isEqualToString:@"Transitions"] && self.slidingViewController.topViewController != self.transitionsNavigationController) { |
| 86 | + if ([menuItem isEqualToString:@"Transitions"]) { |
96 | 87 | self.slidingViewController.topViewController = self.transitionsNavigationController;
|
97 |
| - } else if ([menuItem isEqualToString:@"Settings"] && self.slidingViewController.topViewController != self.settingsNavigationController) { |
98 |
| - self.slidingViewController.topViewController = self.settingsNavigationController; |
| 88 | + } else if ([menuItem isEqualToString:@"Settings"]) { |
| 89 | + self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MESettingsNavigationController"]; |
99 | 90 | }
|
| 91 | + |
100 | 92 |
|
101 | 93 | [self.slidingViewController resetTopViewAnimated:YES];
|
102 | 94 | }
|
|
0 commit comments