ios - UISearchBar doesn't dismiss on push segue -
i'm trying out uisearchcontroller ios 8 right now. when click cell, push segue , show view controller. however, search controller/bar still there on next controller. also, notice status bar background white, while should grey searchbar background color grey. there miss?
this codes used initialise search controller
override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. searchcontroller = uisearchcontroller(searchresultscontroller: nil) searchcontroller.searchresultsupdater = self searchcontroller.hidesnavigationbarduringpresentation = false searchcontroller.dimsbackgroundduringpresentation = false searchcontroller.searchbar.sizetofit() tableview.tableheaderview = searchcontroller.searchbar }
screenshot:
manual stop uisearchcontroller
in prepareforsegue
searchcontroller.active = false
or add in viewdidload
searchcontroller.definespresentationcontext = true
Comments
Post a Comment