uisearchcontroller

iOS 11 Searchcontroller jumps top of screen

一笑奈何 提交于 2019-12-21 12:09:10
问题 having the same issue as already posted (non of the answers works..), my table is a fixed width, and in iOS 10.x the searchbar (which is in the tableviewheader), stays the same size when typing. However in iOS 11, it jumps to the top of the screen and gets stretched out over the total width. All options tried; self.definesPresentationContext = YES; tableHeaderView.clipsToBounds = YES; etc but nothing seems to change.. it still jumps to the top full width.. Any other options? Xcode 9 GM with

Make UISearchController search bar automatically active

让人想犯罪 __ 提交于 2019-12-21 09:40:40
问题 I've implemented a UISearchController with its search bar in a navigatiom bar and I would like to make the search bar active when the view is loaded. When I say active, I mean that the keyboard appears and the user can type his/her search without tap the search bar. I initialised the UISearchController with the following code: - (void)viewDidLoad { self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; [self.searchController setSearchResultsUpdater:self];

Peek and Pop on UITableView cells fails with UISearchController

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 07:04:22
问题 Peek and Pop is working with a UISearchController . However, Peek and Pop stops working once you start searching the table using updateSearchResults . I've extended Apple's Table Search with UISearchController demo to support Peek and Pop as an example: Problem is when I start searching the table, Peek and Pop doesn't work anymore. It just select highlights it: The updates I made were to MainTableViewController are: class MainTableViewController: BaseTableViewController, UISearchBarDelegate,

Searching through objects in array swift

佐手、 提交于 2019-12-21 04:36:08
问题 I'm trying to create a search function using the UISearchController. However i cant seem to make it work with my Team Object. I've started by creating a Team Object which contain a id, name and shortname. Then i'm retrieving the teamData from a url and adding the Team Objects into an array which is populated into a tableView. This tableView contain a searchController which is suppose to filter the Data, but nothing happens. arrays var teamArray = Array<Team>() var filteredTableData = [String]

UISearchController doesn't hide view when pushed

℡╲_俬逩灬. 提交于 2019-12-21 03:41:04
问题 I am using UISearchController to display a search bar and results within a UITableView. I managed to set it up correctly, but when I search the results and then select one of the rows in the tableview, and push a new view controller to the navigation stack, I would expect the search bar to not be visible anymore. However, when I try this, the search bar from the first view controller is visible in the 2nd view controller: if (self.searchController == nil) { self.searchController = [

Swift UISearchController wired up in Core Data Project, app runs, but search not updating

三世轮回 提交于 2019-12-20 10:44:33
问题 I have been wrestling the past few days with creating a filter in a Swift project for a TableViewController that uses Core Data. I finally figured out I need to use a UISearchController , create an NSPredicate for the searchController.searchBar , etc. I found this post EXTREMELY helpful, but after modeling my TVC after this project, I find "all the lights are on, but nobody's home". I can search, predicate is created in searchBar , add, remove, etc. but the cells don't update for the search.

How do you dismiss a UISearchController ? (iOS 8 and follow)

此生再无相见时 提交于 2019-12-20 10:16:50
问题 This must be trivial, but I can't find how you're supposed to dismiss a UISearchController programmatically? Note that it's the new UISearchController (introduced in 2014 with iOS 8), not the UISearchDisplayController. So far here's what I've got // Dismiss the search tableview searchController.dismissViewControllerAnimated() // Clear the Search bar text searchController.active = false But I still have the cancel button and can't get rid of it. 回答1: OK so after more testing, turns out you

How to add scope buttons in a UISearchController embedded in UINavigationController

狂风中的少年 提交于 2019-12-20 06:56:41
问题 I have an App that is presenting a MKMapView embedded in a UINavigationController. In the UINavigationController I have put a UISearchController. When the User touch the UISearchController it displays a UITableViewController. It works well while I'm not adding the Scope button in the UISearchController. Here the screenshot of the UISearchController in the UINavigationController when I start the App. Next when I touch the UISearchController, it displays the UITableViewController and scope

Why is UISearchController changing the navigation bar colors?

北城以北 提交于 2019-12-20 05:28:05
问题 I have tested this on a sample project with 2 view controllers defined in the storyboard using Xcode 11 (iOS 13). The "presenting" view controller is embedded in a navigation controller and has the navigation bar colors set in the viewWillAppear . The "search" view controller adds a UISearchController in the viewDidLoad and is pushed by the presenting view controller (NOT modal). With just this setup when the search view controller is displayed the navigation bar has the blue background and

My UISearchBar in UISearchController disappear when I start searching. Why?

浪子不回头ぞ 提交于 2019-12-19 20:00:08
问题 This is how I setup my UIsearchController private func setupSearchController() { let searchResultsController = storyboard!.instantiateViewControllerWithIdentifier(DBSearchOptionControllerIdentifier) as! DBSearchOptionController searchController = UISearchController(searchResultsController: searchResultsController) let frame = searchController.searchBar.frame searchController.searchBar.frame = CGRectMake(0, 50, view.bounds.size.width, 44.0) searchController.searchResultsUpdater = self view