Skip to content

Small demo project for the various search bar scrolling behaviors found in Apple's apps.

License

Notifications You must be signed in to change notification settings

rajdn/TableViewSearchBar

Repository files navigation

TableViewSearchBar is a small demo project that demonstrates the various scrolling behaviors of a UISearchBar inside a UITableView found in Apple's own apps.

The project has been made in order to answer this stackoverflow question.

There are three different behaviors in Apple's apps:

  • Default: The search bar scrolls with the table view
  • Top: The search bar scrolls with the table view but always stays at the top if you scroll the table view up
  • Header: The search bar usually stays at the top of the table view but scrolls with the table view if you scroll the table view up

The last one is only used in the Contacts app and is quite interesting. Take a look at FKRHeaderSearchBarTableViewController.m in order to see how it works in detail.


Screenshot Screenshot Search


License

MIT License

Copyright (c) 2013 Fabian Kreiser

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Small demo project for the various search bar scrolling behaviors found in Apple's apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published