Browse Source

[v2][iOS] Simplify searchBarHiddenWhenScrolling making its behaviour default to iOS one (#3611)

* Simplify searchBarHiddenWhenScrolling making its behaviour default to iOS one

* Update RNNTopBarOptions.m
Dima Loktev 6 years ago
parent
commit
3b732d0634
2 changed files with 2 additions and 7 deletions
  1. 0
    5
      lib/ios/RNNRootViewController.m
  2. 2
    2
      lib/ios/RNNTopBarOptions.m

+ 0
- 5
lib/ios/RNNRootViewController.m View File

@@ -65,11 +65,6 @@
65 65
 -(void)viewDidAppear:(BOOL)animated {
66 66
 	[super viewDidAppear:animated];
67 67
 	[self.eventEmitter sendComponentDidAppear:self.componentId componentName:self.componentName];
68
-	if (@available(iOS 11.0, *)) {
69
-		if (self.navigationItem.searchController && [self.options.topBar.searchBarHiddenWhenScrolling boolValue]) {
70
-			self.navigationItem.hidesSearchBarWhenScrolling = YES;
71
-		}
72
-	}
73 68
 }
74 69
 
75 70
 - (void)viewWillDisappear:(BOOL)animated {

+ 2
- 2
lib/ios/RNNTopBarOptions.m View File

@@ -44,8 +44,8 @@ extern const NSInteger BLUR_TOPBAR_TAG;
44 44
 				search.searchBar.placeholder = self.searchBarPlaceholder;
45 45
 			}
46 46
 			viewController.navigationItem.searchController = search;
47
-			// enable it back if needed on componentDidAppear
48
-			viewController.navigationItem.hidesSearchBarWhenScrolling = NO;
47
+			
48
+			viewController.navigationItem.hidesSearchBarWhenScrolling = [self.searchBarHiddenWhenScrolling boolValue];
49 49
 			
50 50
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
51 51
 			viewController.definesPresentationContext = YES;