SHSearchBar
SHSearchBar copied to clipboard
The search bar that doesn't suck.
add rtl alignment to library
It could be an ultimate replace for UISearchBar, except for a very big minus. It seems not having a storyboard support, it crashes with "init(coder:) has not been implemented".
Provide labels for all parameters. **fix this in all functions**
Current implementation: ``` func pressedCancelButton(_ sender: AnyObject) { textField.resignFirstResponder() _ = delegate?.searchBarShouldCancel?(self) } ``` Better implementation: ``` func pressedCancelButton(_ sender: AnyObject) { if delegate?.searchBarShouldCancel?(self) ?? true { textField.resignFirstResponder() } }...
Consider setting an inactive version of the left and right views. To implement the active/inactive state of these views, try the following when the active/inactive state of the searchbar changes...
The config object is user unfriendly. The SHSearchBar should own the properties. This would even simplify the tests since now I tests are executed way too often and extremely redundant...
It is important to hide the text field behind a public API. This enables to switch technologies behind the SHSearchBar without affecting users of the framework. Here it is important...