• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Objective-C
  • Created almost 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

按照微信的搜索框自己写了一个UISearchControllerDemo,WeChatSearchController

UISearchControllerDemo

按照微信的搜索框自己写了一个UISearchControllerDemo,WeChatSearchController 最近需要做一个搜索效果和微信搜索页面很类似,我使用UISearchController尝试了很多办法,都不能默认显示searchResultController,经过翻墙查找海量资料,终于做成微信的搜索效果,需要设置的地方只有下面一个地方:

#pragma mark - UISearchResultsUpdating
//每输入一个字符都会执行一次
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController{
    searchController.searchResultsController.view.hidden = NO;
}

就这句,让 searchResultsController 一直显示:

searchController.searchResultsController.view.hidden = NO;

效果如图:
SearchController iPhone 8P SearchController iPhone X

如果小伙伴们喜欢,请为我打call!star!么了个哒~

简书:https://www.jianshu.com/p/a5114f59d3a1
CSDN:https://mp.csdn.net/mdeditor/78801707#