uisearchcontroller

UISearchController with loading indicator

回眸只為那壹抹淺笑 提交于 2019-12-05 20:02:35
I implemented UISearchController and I'm getting the data from a js callback but when I tape in the searchbar it takes some time to put the data so I wanted to know how to implement a loading indicator into the table view result of UISearchController When you start searching at that time you can create an activity indicator and add it as the subview of UISearchBar using addSubView method. UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; //set your frame for activity indicator [searchBar addSubview: spinner];

Navigation bar disappears if reload data with UISearchController

落花浮王杯 提交于 2019-12-05 19:49:58
My application works so that I have a UISearchController in a reusable view inside a UICollectionViewController. When tap in the search bar I click any of the results, and it triggers a notification to reload the collectionView in order to reflect the changes. lazy var searchController: UISearchController = { let tableViewController = UITableViewController(style: .Plain) tableViewController.tableView.dataSource = self tableViewController.tableView.delegate = self tableViewController.tableView.registerClass(StoreListCell.self, forCellReuseIdentifier: "MiniStoreCell") let searchController =

Search Bar disappears after tap on it

混江龙づ霸主 提交于 2019-12-05 16:25:27
Am trying to implement search nearby places using google maps. The below is the code what I have done so far override func viewDidLoad() { super.viewDidLoad() //Adding Mapview mapView = GMSMapView(frame: CGRectMake(0, 120, self.view.bounds.width, self.view.bounds.height - 120)) self.view.addSubview(mapView) mapView.mapType = kGMSTypeNormal locationManager.delegate = self locationManager.requestWhenInUseAuthorization() let resultTableView = UITableView(frame: CGRectMake(10, 100, 300, 60)) self.searchResultController = UITableViewController() self.searchResultController?.tableView =

UISearchController SearchBar misaligns while active during rotation

こ雲淡風輕ζ 提交于 2019-12-05 08:47:49
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 UISearchDisplayController and UISearchBar has been deprecated as of iOS 8 in favour of UISearchController and

iOS8 Swift UISearchController hides navigationbar

烂漫一生 提交于 2019-12-05 06:43:09
I implemented a search function for an UITableViewController like this: self.resultSearchController = ({ let controller = UISearchController(searchResultsController: nil) controller.searchResultsUpdater = self controller.dimsBackgroundDuringPresentation = false controller.searchBar.sizeToFit() self.tableView.tableHeaderView = controller.searchBar return controller })() The problem I've been experiencing is that if I click on it, my navigation bar and my navigationcontrollers header disappear. Is there a solution to stop this behaviour (in swift)? Not clicked: Clicked: The UISearchController

Navigation bar disappears when typing in UISearchController text field

微笑、不失礼 提交于 2019-12-05 04:19:54
I'm trying to figure out why my whole navigation bar disappears when I start typing in the UISearchController.searchBar It loads properly and animates properly, but I lose the active NavBar when I start typing. Here's the code to load the searchController from viewDidLoad: UITableViewController *searchResultsController = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain]; searchResultsController.tableView.dataSource = self; searchResultsController.tableView.delegate = self; searchResultsController.tableView.backgroundColor = [UIColor redColor]; self.searchController = [

UISearchBar subview of UITableViewHeader?

只谈情不闲聊 提交于 2019-12-04 23:38:48
问题 I want to add a UISearchBar to a UITableView that already has a header view. When I try and add the search bar to the existing header view it works until I tap on it, at which point I get The view hierarchy is not prepared for the constraint , which appears to be because the search bar is not a direct subview of the tableview so when the UISearchController tries to update the constraints it can't. The only way around this that I've found is making the table view header the search bar, then

Remove 1px line at top of UISearchController in large titles UINavigationBar

一曲冷凌霜 提交于 2019-12-04 19:09:39
问题 I'm transitioning from a view with a large style UINavigationItem into a view that has a large style UINavigationItem and a UISearchController . I've customized the background colour of the UINavigationBar . For some reason, there's a 1px line or space between the UINavigationBar and the UISearchController . I can tell it's from the NavigationBar , because if I scroll so that the search bar sticks to the top, the line disappears. I'm just not sure what's generating this line. I'm not using

UISearchController's search bar overlaps first tableview cell

谁都会走 提交于 2019-12-04 16:33:33
问题 I am using UISearchController and the UISearchBar also has a scope bar. The search bar is added as a subview to a UIView which is above the UItableView . I have done it this way since I want the search bar to be always visible even when the tableview is scrolled. The problem is the scopebar overlaps the first tableview cell StoryBoard Scope bar overlapping the tableview cell How can I prevent this overlapping?, I can't display the searchbar in navigationbar since the scopebar when placed in

Swift Search Result Controller in search results segue to another view controller

不打扰是莪最后的温柔 提交于 2019-12-04 14:57:48
Problem: I have a table view that the user can either scroll through to find something or use a search bar. The search bar was not created using the StoryBoard. My view has a UISearchController that handles the search bar and search result updating. The issue that I'm running into is that since my SearchResultsController is instantiated by another controller I cannot perform a segue to another view, or at least I can't find the solution. Everything works except for the segue between my Search Results Controller and the view it's destined for. What I would like to do Have my