SearchBar controller set position after tableview scrolling in swift - ios

Tableview With searchBarController reference of
https://blog.apoorvmote.com/add-uisearchcontroller-to-tableview/
working.
I'll Add search Button for show/hide the search controller. If I can scroll tableview after click the search button at navigation bar show searchController at custom position. After search Button click it should hide from the custom position.
Please, help me

Related

how to hide and unhide navigation bar when user scroll the table view in swift?

I have already read this thread Hide NavigationBar when scrolling tableView in CollectionView?
but I still can't get what I want. I know that there is a pod that can do this, but I try to avoid using pod.
I want to hide the navigation bar when the user scroll down the table view, and I want the navigation bar back when the user scroll up back to the top. like in the "today" bar in the App Store.
I have tried to use
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.hidesBarsOnSwipe = true
}
it can hide the navigation bar when I scroll down the table view, but when I scroll up back to the top, the navigation bar still disappear.
you can see here is the .gif file that the I can't unhide the navigation bar back : http://g.recordit.co/zIW2DkCc6j.gif
here is the contraint of my table view
what should I do ? or maybe you have other code ? please share :)
Ok. What you do is right (in code). Just change the top constraint of the table view to the following:

Hide UITabBarController and make view fit

I'm trying to hide tab bar controller when click a button in view, and then show it again when clicking another button. I've checked the code in this link: How to hide tab bar programatically and then expand view to fit but unable to do it.
I need to hide the tab bar controller and expand a UITableView so that there is no empty space where the tab bar is.
Anyone has a solution for this? I'm using Xcode 8 with auto-layout enabled.

Is it possible to add view behind navigation bar in UITableViewController

I wonder if its possible to add a view under the navigation bar in a UITableViewController?
What I would like to do is to add a view under the navigation bar in my UITableViewController so that I can add a search input / filter button to that view. But I want the view to have a fixed position under the navigation bar so that I can hide the navigationbar+view when swiping.
Right now storyboard only lets me add a view in the UITableViewController. And the new view is also swipeable. And the loading indicator shows up above the view when you swipe down.

How to implement UISearchController searchbar along with filter button in swift?

I wanted to implement a search bar in ios swift using UISearchController. I need a button to open a filter screen along side the searchbar, something similar to screenshot attached. I am not able to adjust the width of searchbar in table header view.
Thanks in advance
Create a container view that has both the search bar and your filter button, and set that as the table header view.

UISearchController misplaces UISearchBar

I am using the UISearchController on a modal page to allow a user to search some data. The page uses a table view controller design and the searchBar is in a tableViewCell.
When the user taps on the searchBar, the UISearchController animates the layout to slide the table header to the top of the page and moves the searchbar. However it does not end up in the right place. It does not move sufficiently up.
Anyone have a suggestion on how to help the UISearchController to position the searchBar correctly?
Before tapping the search bar (looks ok)
After tapping the search bar (search bar in wrong place)

Resources