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 to offer all the functionality in the public API like the normal UISearchBar does plus advantages a UITextField has. These are:
UITextField Features
-
[set/get] defaultTextAttributes
-
[set/get] typingAttributes
(the above 2 are better than setting the attributedText directly since we are able to access the attributes and thus are more flexible)
-
[set/get] attributedPlaceholder
-
[set/get] leftView
-
[set/get] rightView
-
[set/get] tintColor (directly maps to the cursor color)
-
[set/get] text
-
[set/get] isEnabled
-
[call] resignFirstResponder()
SHSearchBar Features
- [set/get] cancelButtonTextAttributes
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 to offer all the functionality in the public API like the normal UISearchBar does plus advantages a UITextField has. These are:
UITextField Features
[set/get] defaultTextAttributes
[set/get] typingAttributes
(the above 2 are better than setting the attributedText directly since we are able to access the attributes and thus are more flexible)
[set/get] attributedPlaceholder
[set/get] leftView
[set/get] rightView
[set/get] tintColor (directly maps to the cursor color)
[set/get] text
[set/get] isEnabled
[call] resignFirstResponder()
SHSearchBar Features