iOS 中用于多款优雅搜索风格的搜索控制器(支持 iPhone & iPad ) - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
CoderKo1o
V2EX    分享发现

iOS 中用于多款优雅搜索风格的搜索控制器(支持 iPhone & iPad )

  •  
  •   CoderKo1o 2017-03-20 09:47:41 +08:00 2237 次点击
    这是一个创建于 3201 天前的主题,其中的信息可能已经有所发展或是发生改变。

    PYSearch

    Build Status Pod Version Pod Platform Pod License

    Features

    • Support a variety of hot search style
    • Support a variety of search history style
    • Support a variety of search results display mode
    • Support search suggestions
    • Support search history (record) cache
    • Support callback using delegate or block completion search
    • Support CocoaPods
    • Support localization
    • Support vertical and horizontal screen on iPhone and iPad

    Requirements

    • iOS 7.0 or later
    • Xcode 7.0 or later

    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

    • Use CocoaPods:
      • pod "PYSearch"
      • Import the main file :#import <PYSearch.h>
    • Manual import :
      • Drag All files in the PYSearch folder to project
      • Import the main file :#import "PYSearch.h"

    Details (See the example program PYSearchExample for details)

     // 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

    • 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; 

    Hope

    • If you have any questions during the process or want more interfaces to customize , you can issues me!
    • Instead of giving me star, it is better to throw a bug to me!
    • If you want to participate in the maintenance of this project or have a good design style, welcome to pull request!
    • If you feel slightly discomfort in use, please contact me QQ:499491531 or Email:[email protected].
    • Hope to improve this project together, let it become more powerful, able to meet the needs of most users!

    Licenses

    All source code is licensed under the MIT License.

    目前尚无回复
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     4573 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 21ms UTC 01:06 PVG 09:06 LAX 17:06 JFK 20:06
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86