Explorar el Código

Merge pull request #304 from deltachat/fix_flickering_in_new_chat_view_controller

fix flickering in NewChatViewController (#300)
björn petersen hace 5 años
padre
commit
5d6ad3c033
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3 7
      deltachat-ios/Controller/NewChatViewController.swift

+ 3 - 7
deltachat-ios/Controller/NewChatViewController.swift

@@ -72,23 +72,19 @@ class NewChatViewController: UITableViewController {
         deviceContactHandler.importDeviceContacts()
         navigationItem.searchController = searchController
         definesPresentationContext = true // to make sure searchbar will only be shown in this viewController
+        if #available(iOS 11.0, *) {
+            navigationItem.hidesSearchBarWhenScrolling = false
+        }
     }
 
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         deviceContactAccessGranted = CNContactStore.authorizationStatus(for: .contacts) == .authorized
         contactIds = Utils.getContactIds()
-        // this will show the searchbar on launch -> will be set back to true on viewDidAppear
-        if #available(iOS 11.0, *) {
-            navigationItem.hidesSearchBarWhenScrolling = false
-        }
     }
 
     override func viewDidAppear(_ animated: Bool) {
         super.viewDidAppear(animated)
-        if #available(iOS 11.0, *) {
-            navigationItem.hidesSearchBarWhenScrolling = true
-        }
 
         let nc = NotificationCenter.default
         syncObserver = nc.addObserver(