ios - Change position of UISearchController in Swift -


i have uitableview has uisearchcontroller (added programmatically). searchcontroller added header of tableview.(screenshot 2). however, want have search view first in middle of screen when app opens , after user starts search, tableview appears , start show datas.(screenshot 1)

i try add uisearchbar inside storyboard , connect uisearchcontroller can't assign directly.

screenshot 2 screenshot 1

let searchcontroller = uisearchcontroller(searchresultscontroller: nil)  override func viewdidload() {     super.viewdidload()     // setup search controller     searchcontroller.searchresultsupdater = self     searchcontroller.dimsbackgroundduringpresentation = false     definespresentationcontext = true     mtableview.tableheaderview = searchcontroller.searchbar } 

1# can work around point change tableview size , position @ start tableview middle of screen want , after user start search can change frame view boundary

2# better => can use uitextfield create own search controler , custamize wanted


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -