Update README.md
PYSearch
PYSearchConst
PYSearchViewController
PYSearchSuggestionViewController
UIColor+PYSearchExtension
UIView+PYSearchExtension
NSBundle+PYSearchExtension
pod "PYSearch"
#import <PYSearch.h>
#import "PYSearch.h"
// 1. Create hotSearches array NSArray *hotSeaches = @[@"Java", @"Python", @"Objective-C", @"Swift", @"C", @"C++", @"PHP", @"C#", @"Perl", @"Go", @"JavaScript", @"R", @"Ruby", @"MATLAB"]; // 2. Create searchViewController PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:hotSeaches searchBarPlaceholder:@"Search programming language" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) { // Call this Block when completion search automatically // Such as: Push to a view controller [searchViewController.navigationController pushViewController:[[UIViewController alloc] init] animated:YES]; }]; // 3. present the searchViewController UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:searchViewController]; [self presentViewController:nav animated:NO completion:nil];
Custom search suggestions display
// 1. Set dataSource searchViewController.dataSource = self; // 2. Implement dataSource method
Custom search result dispaly
// 1. Set searchResultShowMode searchViewController.searchResultShowMode = PYSearchResultShowModeEmbed; // 2. Set searchResultController searchViewController.searchResultController = [[UIViewController alloc] init];
Set hotSearchStyle(default is PYHotSearchStyleNormalTag)
// Set hotSearchStyle searchViewController.hotSearchStyle = PYHotSearchStyleColorfulTag;
Set searchHistoryStyle(default is PYSearchHistoryStyleCell)
// Set searchHistoryStyle searchViewController.searchHistoryStyle = PYSearchHistoryStyleBorderTag;
Set searchHistoriesCachePath(default is PYSEARCH_SEARCH_HISTORY_CACHE_PATH)
// Set searchHistoriesCachePath searchViewController.searchHistoriesCachePath = @"The cache path";
Set searchHistoriesCount(default is 20)
// Set searchHistoriesCount searchViewController. searchHistoriesCount = 6;
Set searchResultShowMode(default is PYSearchResultShowModeCustom)
// Set searchResultShowMode searchViewController.searchResultShowMode = PYSearchResultShowModeEmbed;
Set searchSuggestionHidden(deafult is NO)
// Set searchSuggestionHidden searchViewController.searchSuggestionHidden = YES;
All source code is licensed under the MIT License.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
QQ chat room
Features
Requirements
Architecture
Main
PYSearch
PYSearchConst
PYSearchViewController
PYSearchSuggestionViewController
Category
UIColor+PYSearchExtension
UIView+PYSearchExtension
NSBundle+PYSearchExtension
Contents
Renderings
Styles
Hot search style
Search history style
How to use
pod "PYSearch"
#import <PYSearch.h>
PYSearch
folder to project#import "PYSearch.h"
Details (See the example program PYSearchExample for details)
Custom
Custom search suggestions display
Custom search result dispaly
Set hotSearchStyle(default is PYHotSearchStyleNormalTag)
Set searchHistoryStyle(default is PYSearchHistoryStyleCell)
Set searchHistoriesCachePath(default is PYSEARCH_SEARCH_HISTORY_CACHE_PATH)
Set searchHistoriesCount(default is 20)
Set searchResultShowMode(default is PYSearchResultShowModeCustom)
Set searchSuggestionHidden(deafult is NO)
Hope
Licenses
All source code is licensed under the MIT License.