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
 -(void)viewDidAppear:(BOOL)animated {
65
 -(void)viewDidAppear:(BOOL)animated {
66
 	[super viewDidAppear:animated];
66
 	[super viewDidAppear:animated];
67
 	[self.eventEmitter sendComponentDidAppear:self.componentId componentName:self.componentName];
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
 - (void)viewWillDisappear:(BOOL)animated {
70
 - (void)viewWillDisappear:(BOOL)animated {

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

44
 				search.searchBar.placeholder = self.searchBarPlaceholder;
44
 				search.searchBar.placeholder = self.searchBarPlaceholder;
45
 			}
45
 			}
46
 			viewController.navigationItem.searchController = search;
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
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
50
 			// Fixes #3450, otherwise, UIKit will infer the presentation context to be the root most view controller
51
 			viewController.definesPresentationContext = YES;
51
 			viewController.definesPresentationContext = YES;