Monday, 25 June 2018

searchController abnormal behaviour

class SearchMembers: UITableViewController, UISearchControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
        navigationItem.title = NSLocalizedString("MEMBERS", comment: "")

            let search = UISearchController(searchResultsController: nil)
            self.definesPresentationContext = true
            search.searchResultsUpdater = self
            search.dimsBackgroundDuringPresentation = false
            navigationItem.searchController = search
            navigationItem.hidesSearchBarWhenScrolling = false

    }

When I perform segue from a tableview cell, I can see the search controller as It should be but When I perform a segue from a navigation bar item, I only see a space without search bar. Then, I go back to the previous view, search controller bar appears there.
It goes back to normal behavior If I go back to search view again.
A possible bug?
enter image description here
Should be: enter image description here
EDIT:
I realized that If I unselect "Animates" option from segue settings, I don't get an empty space in searchController view but I still get an empty space when I go back to main view


from searchController abnormal behaviour

No comments:

Post a Comment