Kaynağa Gözat

Remove duplicate setDefaultOptions in UIViewController categories (#5448)

This is already defined in UIViewController+LayoutProtocol and depending 
on the load order will actually prevent the default orders from being 
set
Danilo Bürger 5 yıl önce
ebeveyn
işleme
0d31e30800

+ 0
- 2
lib/ios/UIViewController+RNNOptions.h Dosyayı Görüntüle

@@ -6,8 +6,6 @@
6 6
 
7 7
 @interface UIViewController (RNNOptions)
8 8
 
9
-- (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions;
10
-
11 9
 - (void)rnn_setBackgroundImage:(UIImage *)backgroundImage;
12 10
 
13 11
 - (void)rnn_setModalPresentationStyle:(UIModalPresentationStyle)modalPresentationStyle;

+ 7
- 11
lib/ios/UIViewController+RNNOptions.m Dosyayı Görüntüle

@@ -10,10 +10,6 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
10 10
 
11 11
 @implementation UIViewController (RNNOptions)
12 12
 
13
-- (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions {
14
-
15
-}
16
-
17 13
 - (void)rnn_setBackgroundImage:(UIImage *)backgroundImage {
18 14
 	if (backgroundImage) {
19 15
 		UIImageView* backgroundImageView = (self.view.subviews.count > 0) ? self.view.subviews[0] : nil;
@@ -21,7 +17,7 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
21 17
 			backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
22 18
 			[self.view insertSubview:backgroundImageView atIndex:0];
23 19
 		}
24
-		
20
+
25 21
 		backgroundImageView.layer.masksToBounds = YES;
26 22
 		backgroundImageView.image = backgroundImage;
27 23
 		[backgroundImageView setContentMode:UIViewContentModeScaleAspectFill];
@@ -36,7 +32,7 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
36 32
 	self.modalTransitionStyle = modalTransitionStyle;
37 33
 }
38 34
 
39
-- (void)rnn_setSearchBarWithPlaceholder:(NSString *)placeholder 
35
+- (void)rnn_setSearchBarWithPlaceholder:(NSString *)placeholder
40 36
 						hideNavBarOnFocusSearchBar:(BOOL)hideNavBarOnFocusSearchBar {
41 37
 	if (@available(iOS 11.0, *)) {
42 38
 		if (!self.navigationItem.searchController) {
@@ -52,7 +48,7 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
52 48
 			search.hidesNavigationBarDuringPresentation = hideNavBarOnFocusSearchBar;
53 49
 			self.navigationItem.searchController = search;
54 50
 			[self.navigationItem setHidesSearchBarWhenScrolling:NO];
55
-			
51
+
56 52
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
57 53
 			self.definesPresentationContext = YES;
58 54
 		}
@@ -161,7 +157,7 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
161 157
 		return YES;
162 158
 	if([[[self tabBarController] presentingViewController] isKindOfClass:[UITabBarController class]])
163 159
 		return YES;
164
-	
160
+
165 161
 	return NO;
166 162
 }
167 163
 
@@ -182,12 +178,12 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
182 178
 		[self.navigationController.navigationBar setBackIndicatorImage:[UIImage new]];
183 179
 		[self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:[UIImage new]];
184 180
 	}
185
-	
181
+
186 182
 	UIViewController *lastViewControllerInStack = self.navigationController.viewControllers.count > 1 ? self.navigationController.viewControllers[self.navigationController.viewControllers.count - 2] : self.navigationController.topViewController;
187
-	
183
+
188 184
 	backItem.title = title ? title : lastViewControllerInStack.navigationItem.title;
189 185
 	backItem.tintColor = color;
190
-	
186
+
191 187
 	lastViewControllerInStack.navigationItem.backBarButtonItem = backItem;
192 188
 }
193 189