uisearchcontroller

Typing in UISearchBar crashes my app

眉间皱痕 提交于 2019-12-11 04:03:10
问题 UPDATE 2 My app is crashing when presenting it modally after a user taps a button in ViewController1. In my storyboard, I have a standard present modally segue set to pop up the UINavController/UITableViewController containing the UISearchBar . That's failing every time. However, in my AppDelegate , if I set the window's rootViewController to the same UINavController/UITableViewController, everything works as expected. For some reason transitioning via segue and then acting the UISearchBar is

updatesearchresultsforsearchcontroller not called

我是研究僧i 提交于 2019-12-11 02:31:38
问题 Does anyone know why its not being called here? Thanks. I think I set up the delegate correctly. class LocationSearchController: UIViewController, UISearchResultsUpdating, UINavigationBarDelegate, UISearchControllerDelegate { let navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 44)) var locationSearchController: UISearchController! override func viewDidLoad() { super.viewDidLoad() locationSearchController = UISearchController

Swift - Search data not loading

筅森魡賤 提交于 2019-12-11 01:27:22
问题 I'm trying to add a search feature to my app with Parse, I have wrote the code with a UISearchController , but for some reason when I load the app and try to search nothing works. My parse is all set up correctly, so there must be something wrong with my code! Here it is: import UIKit import Parse class SearchTableViewController: UITableViewController, UISearchResultsUpdating { var searchResults = [String]() var resultSearchController = UISearchController() override func viewDidLoad() {super

UISearchController for TableView

霸气de小男生 提交于 2019-12-11 01:06:10
问题 This is what my Table View looks like. Each cell Strings a text from a .txt Search Filter works fine. But When I select one of the results e.g. "How" it prints the the Content of "Hello" instead. I'm thinking this is probably because "Hello" is programmed as the first String so it will always be the result of the first cell when clicked. I am needing help with figuring out how the search results are linked to it's own content. if that makes any sense? Here's the code below. The code reads

Filtering an Array inside a Dictionary - Swift

不羁岁月 提交于 2019-12-10 22:49:55
问题 I am trying to search through a indexed dictionary to return a specific client based on the client's last name. Below are the data structures I am using. Each client object has a name property which is a String. var clients = Client.loadAllClients() //Returns client array var contacts = [String: [Client]]() //Indexed clients in a dictionary var letters: [String] = [] var filteredClient = [Client]() var shouldShowSearchResults = false var searchController : UISearchController! When I do my

UISearchController searchBar disappears on first click

流过昼夜 提交于 2019-12-10 16:57:29
问题 I have implemented a UISearchController in a TableView, pushed by a Navigation Controller. First my problem was that whenever I click on the SearchBar, it disappears. It works when I enter some text, but it stays completely blank. Then I managed to semi solve the issue using this code: - (void)searchForText:(NSString*)searchText { [self.view addSubview:villeSearchController.searchBar]; } Which semi-works because now, when I click on the search bar, it blanks out, but if I enter one character,

Search bar gets cut off when using UISearchController with a UITabBarController inside a UINavigationController

你。 提交于 2019-12-10 15:59:33
问题 I have an application that has a UITabBarController in a UINavigationController . (The UITabBarController is not the "Initial View Controller" for the story board.) In the initial UIViewController , I have a UISearchController which allows for content to be searched from a remote source. This worked fine until I added the UITabBarController . Now, the search bar displays fine in the default state, but once you start typing inside of it, it gets pushed up past the top edge of the view. I

Swift : show searchbar when scroll up and hide it when scroll down

ε祈祈猫儿з 提交于 2019-12-10 15:18:41
问题 I am new to Ios develpomment, I added a Searchbar into the navigation item What I would like to implement is when I scroll Up the tableview I want to hide the Searchbar and when show it when I scroll down Like safari effect on iPAD /Iphone where the address bar is hiding when scrolling Down and showing when scrolling Up let searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.obscuresBackgroundDuringPresentation =

Header view is not display after search iOS8 + XCode6

为君一笑 提交于 2019-12-10 13:45:30
问题 I have working application for iOS7 and below I used UISearchDisplayController for search in table. Problem : After search header view is not display in iOS8. as display in below images. Before search : After search : I tried using UISearchController but also have same problem i used this code link I add below code in TPSMastreViewController.m - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *v = [[UIView alloc] init]; v.backgroundColor =

How do I set the UISearchController's searchBar to a view that isn't the tableHeaderView or navigationItem.titleview?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:30:38
问题 I'm trying to keep the search bar in view as the table scrolls. At the moment I'm placing it as the header in a tableview, and it works as it should, but of course the search bar scrolls off screen as you go down the table. I thought I could do this simply modifying this code sample: How do I use UISearchController in iOS 8 where the UISearchBar is in my navigation bar and has scope buttons? searchController = UISearchController(searchResultsController: nil) searchController