uisearchcontroller

UIsearchController inside UIViewController using Auto Layout

ぐ巨炮叔叔 提交于 2021-02-18 14:15:34
问题 Has anyone been successful implementing a UIViewController that contais both a UISearchController searchBar and a UItableView while laying everything out using Auto Layout? I'm trying to achieve something similar to what 1Password does on the iPhone: a fixed searchBar on top of a tableView (not part of its tableHeaderView ). When the UISearchController that owns the searchBar gets activated, its searchBar animates to show the scope buttons and thus the tableView moves down a bit. I have got

Search Controller in navigation item show black bar

雨燕双飞 提交于 2021-02-08 03:01:46
问题 Hi I have setup search controller using private func setupSearchbar() { searchController = UISearchController(searchResultsController: nil) searchController.searchResultsUpdater = self searchController.obscuresBackgroundDuringPresentation = false searchController.searchBar.placeholder = "Search Contacts" self.navigationItem.searchController = searchController self.definesPresentationContext = true } Everything was working fine until I add this code UINavigationBar.appearance().isOpaque = true

self.definesPresentationContext = true: leads to black screen?

大憨熊 提交于 2021-01-28 21:13:01
问题 let searchController = UISearchController(searchResultsController: nil) override func viewDidLoad() { super.viewDidLoad() searchController.searchResultsUpdater = self searchController.dimsBackgroundDuringPresentation = false // searchController.definesPresentationContext = true self.definesPresentationContext = true When the search bar is active, with text in it, and I go to another tab and then back, the controller is black, apart from the actual search bar. Things go back to normal when I

Hide SearchController again after scrolling down

こ雲淡風輕ζ 提交于 2020-07-22 05:50:07
问题 I got SearchController to show up with my TableView, this is what is looks like on launch vs when I scroll up: This is perfect since I want it hidden when not in use. However, after showing it, I can't hide it again by scrolling down. How do I get that functionality? import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UISearchControllerDelegate, UISearchResultsUpdating { @IBOutlet weak var tableView: UITableView! func updateSearchResults(for

Tab bar view goes blank when switched back to with search bar active

天涯浪子 提交于 2020-07-20 07:10:38
问题 Update 2: Since people are still looking at this question: know that I realized it's impossible to replicate this bug on an actual, isolated iOS device. When you present the search controller, iOS presents a keyboard as well, which covers the tab bar. To switch tabs, you must dismiss the keyboard, which will dismiss the search controller as well. The reason I say "isolated" is because I don't know if you can replicate this with a Bluetooth keyboard and don't have one to try. The iOS keyboard

updateSearchResults() not getting called

拈花ヽ惹草 提交于 2020-05-28 18:07:27
问题 I have read similar problems and solutions on SO. But none seems to solve my problem. I am using Custom Search Controller and Custom Search Bar and func updateSearchResults(for searchController: UISearchController) is not getting called. var customSearchController: CustomSearchViewController! CustomSearchViewController: In ViewDidLoad() customSearchController = CustomSearchViewController(searchResultsController: ***nil***, searchBarFrame: CGRect(x: 0.0, y: 0.0, width: searchTableView.frame

How to place UISearchController to the navigationTitle and how to enable and disable it by button?

。_饼干妹妹 提交于 2020-05-08 17:34:01
问题 I am new to Swift and wondering if there any possibilities to place UIsearchcontroller in navgationtitle and to hide and unhide uisearchcontroller by button that is located as navigationRightItem. I have seen many examples with placing the UISearchBar from Object library to the navigationTitle, but there is no example with the uisearchcontroller. Some even say that UISearch bar from object library has been deprecated from ios10 Swift. Please clarify the deprecation and why i should refrain