Calling and configuring UISearchController in viewWillAppear to implement Search View, SearchBar layout became bad
Environment
What's happened?
Collapsed layout of SearchBar
Search View
Input text in SearchBar
Search Result
Search Target Data can be divided to some layer, so use section and side index list to show them in TableView
Goes to detail page by tapping result cell and tapping back button of NavigationBar....
Width of SearchBar get small of size of width of side index list
And try to search again...
omg....
How to Overcome?
Problems
- Called and Configured UISearchController in viewWillAppear
- Search result data is not deleted when backed from detail page after searching. And Configure UISearchController in view will appear
Improve
- Want to keep search result data and search word showed unless user intentionally delete them
- So Call UISearchController in viewDidLoad
Result
Not so bad....