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

python - How to clone or copy a list? -

The SDK directory does not exist (ubuntu 16.04) (react native) -

linux - How to use Android ltrace tool to trace an app? -