mortimer eeea6b3646 加了商城 | %!s(int64=6) %!d(string=před) roky | |
---|---|---|
.. | ||
PYSearch | %!s(int64=6) %!d(string=před) roky | |
LICENCE | %!s(int64=6) %!d(string=před) roky | |
README.md | %!s(int64=6) %!d(string=před) roky |
PYSearch
PYSearchConst
PYSearchViewController
PYSearchSuggestionViewController
UIColor+PYSearchExtension
UIView+PYSearchExtension
NSBundle+PYSearchExtension
Getting Started
Usage
pod "PYSearch"
#import <PYSearch.h>
PYSearch
folder to project#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 PYS