uisearchcontroller

UISearchController retain issue

我怕爱的太早我们不能终老 提交于 2019-12-01 05:52:02
问题 I am trying to use UISearchController however I confronted with retain issue that I can't solve. MainTableview has two sections. Section 1 Filtered Data based on some Regex Section 2 All Data I added UISearchController to my tableview and attached ResultsTableController as resultsTableController. It works when user search something, ResultsTableController comes forward and because I set tableview delegate to self, selecting item from ResultsTableController calls didSelectRowAtIndexPath in my

UISearchController SearchBar misaligns while active during rotation

与世无争的帅哥 提交于 2019-12-01 03:53:00
问题 I have been struggling with UISearchController's search bar for quite a while now. I need a search feature to be implemented on a tableview but unlike conventional methods, I didn't put the search bar on a table header view. Instead, I created a UIView and added the search bar as a subview to it. The UIView which acts as a container to search bar has its constraints properly set on the storyboard with auto layout. Here are my codes for it. Note that I did this programmatically because

How to animate alongside a UISearchController presentation/dismissal animation?

断了今生、忘了曾经 提交于 2019-12-01 03:22:22
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 of the <UIViewControllerTransitionCoordinator> object. Specifically, searchController

iOS 11 UIRefreshControl with NavigationBar LargeTitle and SearchController disappearing

风格不统一 提交于 2019-12-01 03:04:21
I have a navigationBar with largeTitle and searchcontroller and my tableView has a refreshcontrol. When I pull to refresh the activityIndicator of refreshcontrol disappear but de refresh process continues, even when the process finish and I call .endRefreshing() of UIRefreshControll the navigationBar doesn't back to the normal size. Someone with the same problem? xxtesaxx I searched a solution for this for weeks already and today, I finally made it work. The solution is so simple, I can't believe I haven't found that earlier. I was using a normal UIViewController with a UITableView. My layout

Custom UISearchController Animation

筅森魡賤 提交于 2019-12-01 02:56:47
The Bottom Line Question: How do I override the default animation for the dismissal of a searchBar belonging to a UISearchController? Standard Search Controller Behavior: Okay so I am trying to create a custom animation for when the UISearchBar that is attached to a UISearchController becomes active. It seems the standard animation expects for the searchBar to begin with a width that takes up the screen. When the animation begins it shrinks the searchBar and fades in a cancel button to the right of it. What I want to Achieve: I want to have my searchBar begin in a small state, roughly half the

Using UISearchController with UISearchBar in tableHeaderView in iOS11

烈酒焚心 提交于 2019-12-01 02:12:24
问题 Has anyone successfully retained a UISearchBar in a tableHeaderView of a UITableView in ios11? Problems usually arise with iPhone X in landscape: Apple recommends using the new searchController property: if (@available(iOS 11.0, *)) { self.navigationItem.searchController = self.searchController; self.navigationItem.hidesSearchBarWhenScrolling = NO; } else { self.tableView.tableHeaderView = self.searchController.searchBar; } However this doesn't always work. Here is an example with code: iOS11

iOS 11 UIRefreshControl with NavigationBar LargeTitle and SearchController disappearing

南笙酒味 提交于 2019-11-30 22:17:07
问题 I have a navigationBar with largeTitle and searchcontroller and my tableView has a refreshcontrol. When I pull to refresh the activityIndicator of refreshcontrol disappear but de refresh process continues, even when the process finish and I call .endRefreshing() of UIRefreshControll the navigationBar doesn't back to the normal size. Someone with the same problem? 回答1: I searched a solution for this for weeks already and today, I finally made it work. The solution is so simple, I can't believe

Search bar jumps down one row every time cancel button is tapped

隐身守侯 提交于 2019-11-30 20:17:06
I have implemented a UISearchBar to search through a catalogue of items from an external API. The Search functionality works as expected, however the problem is that every time I press the cancel button, which is on the right side of the search bar text field, the whole search bar moves down by one row and it looks like it pushes the entire table view down as well. So if I type a letter into the search bar text field, then press cancel, the search bar text field moves down by 44px, which is the row height, and the table view itself also gets pushed down by the same amount. If i continuously

UISearchController makes the controller black

社会主义新天地 提交于 2019-11-30 19:02:17
I am using UISearchController in iOS 8 with the following intializaiton in viewDidLoad of a view controller embedded in a tab controller _searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; _searchBar = _searchController.searchBar; [_searchController.searchBar sizeToFit]; _searchController.searchBar.delegate = self; _searchController.searchResultsUpdater = self; _searchController.dimsBackgroundDuringPresentation = NO; _searchController.hidesNavigationBarDuringPresentation = NO; self.definesPresentationContext = NO; _shopsTable.tableHeaderView =

UISearchBarController iOS 11 issue - SearchBar and scope buttons overlap

大憨熊 提交于 2019-11-30 17:38:09
Referred here and here . No answer in first link. In the second link, though the answer is not accepted, but the link to apple developer forum gives error. Before iOS 11 : iOS 11 : Note : Same device same code. Also, this would mean, all apps using this feature have to be republished ? Adding these lines fixed it for me: override func viewDidLayoutSubviews() { self.searchController.searchBar.sizeToFit() } I can get the initial appearance to display correctly in iOS11 using the following code (as per greg's answer): [self.searchController.searchBar sizeToFit]; if (@available(iOS 11.0, *)) {