[![CI Status](http://img.shields.io/travis/Stefan Herold/SHSearchBar.svg?style=flat)](https://travis-ci.org/Stefan Herold/SHSearchBar)
The clean and shiny search bar that does what UISearchBar does only with dirty hacks. This search bar class is designed to overcome the customization limits of UISearchBar. The difference here is that this class does not inherit UISearchBar but composes a new UIView object by using a UITextField that is much easier to use. The limits of the search bar are as follows:
- no clean way to left align the placeholder
- the cancel button is hard to taylor to your needs
- generally the appearance is not customizable (e.g. the font of the text)
- there are some strange behaviours when you set a custom background image
Since I use a UITextField these restrictions do not apply.
The example project shows different use cases of the searchbar. To run it, clone the repo, and run pod install
from the Example directory first.
SHSearchBar is compatible with iOS 8
or higher and build with Xcode 8 beta 4
and the newest Swift 3
syntax. It is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SHSearchBar"
- solve the scaling text on textField width animation bug when there are multiple SHSearchBars on the same view (liek the example)
- put the examples with images in this readme
- add support for a blurred background view
- test programmatic use
- implement storyboard support (low priority)
Stefan Herold, [email protected]
SHSearchBar is available under the MIT license. See the LICENSE file for more info.