ios - UISearchController makes content of the UITableView black -


i have problem uisearchcontroller in combination uitabbarcontroller. have 3 tabs. in every tab, have uitableviewcontroller search bar uisearchcontroller set header view of table view follows.

searchcontroller = uisearchcontroller(searchresultscontroller: nil) searchcontroller.searchresultsupdater = self searchcontroller.dimsbackgroundduringpresentation = false searchcontroller.hidesnavigationbarduringpresentation = true tableview.tableheaderview = searchcontroller.searchbar tableview.contentoffset = cgpointmake(0, cgrectgetheight(searchcontroller.searchbar.frame)) 

if start searching , switch other tab without canceling search , return previous tab, content of uitableview become black. have read multiple postings such uisearchcontroller makes controller black or uisearchcontroller causes black screen swift 2.0. these solutions not work me. if setting

definespresentationcontext = true 

then problem first occur. if omit line content of table view not becomming black search bar stay activated in searching state on next tab. tried setting searchresultscontroller uitableviewcontroller not solve problem too.

i faced same problem,fixed adding following line in viewdiddisappear

    self.searchcontroller.active = false  

usually, value of property determine whether search results displayed. however, can set property true force search interface appear, if user has not taps in search field.

the default value of property false.

  • from above description says default value isfalse if user interacts searchcontroller switches true.
  • in our case issue occurs if switch tab's when uisearchcontroller active.so need deactivate programatically while switching other vc.

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -