See CHANGELOG for details
Awesome search view, written in Swift 3, appears search view like Pinterest Search view. You can fully customizable this library.
YNSearch
written in Swift 3. Compatible with iOS 8.0+
YNSearch is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'YNSearch'
github "younatics/YNSearch"
Set database(Required), categories(Required) and search histories(Optional).
import YNSearch
let demoDatabase = ["Menu", "Animation", "Transition", "TableView", "CollectionView", "Indicator", "Alert", "UIView", "UITextfield", "UITableView", "Swift", "iOS", "Android"]
ynSearch.setDatabase(value: demoDatabase)
ynSearch.setCategories(value: demoDatabase)
ynSearch.setSearchHistories(value: demoDatabase)
self.ynSearchinit()
Done!
YNSearchViewController: Inherit this viewcontroller
|-- YNSearchTextFieldView: YNSearchTextField with cancel button
| |-- YNSearchTextField: Search UITextfield
| |-- cancelButton: Show when YNSearchTextField textFieldDidBeginEditing
|
|-- YNSearchView : get both YNSearchMainView and YNSearchListView
| |-- YNSearchMainView: First view that you can see
| | |-- categoryLabel: Cateogry label
| | |-- [YNCategoryButton]: cateogory buttons
| | |-- searchHistoryLabel: Search history label
| | |-- [YNSearchHistoryView]: history views
| ย | ย | |-- [YNSearchHistoryButton]: Search history button
| ย | ย | |-- [closeButton]: Close button
| ย |
| ย |-- YNSearchListView: UITableview with search result
set YNSearchDelegate
if you want callback
self.delegate = self
func ynSearchHistoryButtonClicked(text: String) {
print(text)
}
func ynCategoryButtonClicked(text: String) {
print(text)
}
func ynSearchListViewClicked(text: String) {
print(text)
}
Set YNCategoryButton
type.
self.ynSearchView.ynSearchMainView.setYNCategoryButtonType(type: .colorful)
YNSearch is available under the MIT license. See the LICENSE file for more info.