We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#warning 初始化的时候hotSearches为nil PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:nil searchBarPlaceholder:@"搜索编程语言" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) { // 开始搜索执行以下代码 // 如:跳转到指定控制器 [searchViewController.navigationController pushViewController:[[PYTempViewController alloc] init] animated:YES]; }]; searchViewController.view.backgroundColor = [UIColor whiteColor]; // 3. 设置风格 if (indexPath.section == 0) { // 选择热门搜索 searchViewController.hotSearchStyle = (NSInteger)indexPath.row; // 热门搜索风格根据选择 searchViewController.searchHistoryStyle = PYHotSearchStyleDefault; // 搜索历史风格为default } else { // 选择搜索历史 searchViewController.hotSearchStyle = PYHotSearchStyleDefault; // 热门搜索风格为默认 searchViewController.searchHistoryStyle = (NSInteger)indexPath.row; // 搜索历史风格根据选择 } // 4. 设置代理 searchViewController.delegate = self; dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{ searchViewController.hotSearches = @[@"Java", @"Python", @"Objective-C", @"Swift", @"C", @"C++", @"PHP", @"C#", @"Perl", @"Go", @"JavaScript", @"R", @"Ruby", @"MATLAB"]; #warning 如果没有这句调用,标签的style就会变成默认值 // searchViewController.hotSearchStyle = PYHotSearchStyleBorderTag; }); }); }); // 5. 跳转到搜索控制器 UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:searchViewController]; [self presentViewController:nav animated:NO completion:nil];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: