uisearchcontroller

How do I create a UISearchController since UISearchDisplayController is deprecated in iOS 8?

◇◆丶佛笑我妖孽 提交于 2019-12-10 11:36:03
问题 There is NO UISearchController in IB, only the UISearchDisplayController; where do I find docs on creating it? 回答1: From documentation; Important: UISearchDisplayController is deprecated in iOS 8. (Note that UISearchDisplayDelegate is also deprecated.) To manage the presentation of a search bar and display search results in iOS 8 and later, instead use UISearchController. Read UISearchController documentation. There is an example how to create UISearchController , not in IB but

Cancelling search with UISearchController causes crash

依然范特西╮ 提交于 2019-12-10 07:02:50
问题 In our app we have a UITableViewController that has a UISearchController: searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.searchResultsUpdater = self; [self.searchController.searchBar sizeToFit]; self.tableView.tableHeaderView = self.searchController.searchBar; self.showFooterView = YES; self.searchController.delegate = self; self.searchController.dimsBackgroundDuringPresentation = NO; // default is YES self.searchController.searchBar

SearchController issue, when search the displayController shows a spacing from the Searchbar

南楼画角 提交于 2019-12-10 00:05:26
问题 The issue is this: In the storyboard , I must uncheck the Adjust Scroll View Insets , because if not do this, I will get a other issue(UISearchController issue, NSLayoutAttribute do not work in real device), and I don't know this if is affect the issue here.(I test in simulator, if check Adjust Scroll View Insets , the issue here will not appear ) My code import UIKit import SVProgressHUD class ChooseStoreViewController: UIViewController,UISearchBarDelegate, UITableViewDelegate,

UISearchController change 'Cancel' button title

感情迁移 提交于 2019-12-09 13:16:03
问题 How we can change the title of cancel button in search controller? 回答1: You can change the "Cancel" Button in search bar using this- for (UIView *view in searchBar.subviews) { for (id subview in view.subviews) { if ( [subview isKindOfClass:[UIButton class]] ) { [subview setEnabled:YES]; UIButton *cancelButton = (UIButton*)subview; [cancelButton setTitle:@"hi" forState:UIControlStateNormal]; NSLog(@"enableCancelButton"); return; } } } 回答2: The solution provided above could change with new iOS

Getting black screen on using tab bar while searching using SearchController

隐身守侯 提交于 2019-12-09 03:08:15
问题 I have an app with a tab bar controller embedded in a navigation controller. The app has 2 tabs, the first one(search) has a search bar implemented using the UISearchController. If I switch from this tab to the other tab(downloads) while I'm searching, to the other tab two things happen - The navigation bar in the second tab(downloads) disappears When i come back to the first tab(search), it shows a black screen I have done all this using the storyboard. this is my SearchViewController import

How to animate alongside a UISearchController presentation/dismissal animation?

岁酱吖の 提交于 2019-12-09 02:51:27
问题 I have a table view with a search bar in the tableHeaderView , managed by a UISearchController . I use the standard UISearchController presentation animation. I want to animate another view with the same duration as the searchBar animation. I tried various duration values but alas they don't match perfectly at all times. So I thought it would be great to make use of the -[UIViewControllerTransitionCoordinator animateAlongsideTransition:completion:] API. Unfortunately I can't find a reference

UISearchController won't dismiss searchbar and overlap for iOS 8 Swift

元气小坏坏 提交于 2019-12-08 16:33:29
问题 I'm having problem with the UISearchController where if I have text in the searchbar and dismiss the VC it's in, the searchBar won't go away and just remain on screen overlapping everything in other VCs. Then it crashes if you hit the cancel button. Have tried a few solutions on SO but none have worked. :/ self.resultSearchController = ({ let controller = UISearchController(searchResultsController: nil) controller.searchResultsUpdater = self controller.dimsBackgroundDuringPresentation = false

Why does the UISearchBar appear to have a strange flash when navigating back?

﹥>﹥吖頭↗ 提交于 2019-12-08 15:58:23
问题 I've got a UISearchBar in my UINavigationItem's titleView associated with a UISearchController. When I navigate back, it appears to flash. Anyone seen this before? vid of flash @interface HNTileSearchViewController () <HNTileSearchResultsProtocol, SWRevealViewControllerDelegate, UISearchBarDelegate, HNSetSearchFiltersProtocol, HNKeywordResultsProtocol> ... @property (nonatomic, strong) UISearchController *searchController; @property (nonatomic, strong) UISearchBar * searchBarTop; ... @end

UISearchController - Search text clear icon does not hide completely

和自甴很熟 提交于 2019-12-08 10:08:45
问题 I am setting up searchController as below in viewDidLoad() in my view controllers. One VC has table view embedded and another is UITableViewController. I am using another VC to allow user to select a value and use that to filter tables items using unwind segue. self.searchController.obscuresBackgroundDuringPresentation = false self.searchController.hidesNavigationBarDuringPresentation = true if #available(iOS 11.0, *) { self.searchController.searchBar.delegate = self self.navigationItem

UISearchController showing fullscreen instead of a popup on iPad

穿精又带淫゛_ 提交于 2019-12-08 09:18:09
问题 I want to build a search control like the maps app; the search opens a result tableview (which works fine) on iPhone and should open a tableview in a popover on iPad. This used to be automatic in UISearchDisplayController but does not work anymore and it shows a fullscreen tableview on iPad. self.resultsController = [[EFResultTableViewController alloc] init]; [self.resultsController.tableView setDelegate:(id<UITableViewDelegate>)self]; self.searchController = [[UISearchController alloc]