UISearchController in NavigationItem iOS 11 Apple way
Asked Answered
M

1

10

In iOS 11 Apple presented new search bar, but yet in iOS 11.2.2 developer have push\pop animation bug when both view controllers have searchController. Apple demonstrate their vision in Files app. Do someone know how do it?

Demo

edit#1

Question with broken animation. Broken UISearchBar animation embedded in NavigationItem

Mercie answered 16/1, 2018 at 9:39 Comment(7)
What is the 'bug' you are seeing exactly?Rosemari
"Bug" will be if i try do similar with native methods. This is right way, but i don`t know how did itMercie
So that is showing the correct way and looks ok? You are doing it using 'native' methods and it's not working? Well start by showing what you are getting and then code you are using.Rosemari
edited post with link on animation bugMercie
So is this a new question then or are you looking for an answer to that one?Rosemari
I am looking how to do like on gif. Like Apple realize in their apps. All ways that I finded are workarounds and don't look like in Files appMercie
Ok cool. Post the code/setup you have tried so far.Rosemari
C
0

enter image description here

you can add some line of code in ViewController -viewDidLoad some line of code for search bar in navigation bar

self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationItem.largeTitleDisplayMode = .automatic
let search = UISearchController(searchResultsController: nil) // Declare the searchController
self.navigationItem.searchController = search
Confront answered 24/1, 2020 at 8:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.