This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
open class NiblessViewController: UIViewController { | |
public init() { | |
super.init(nibName: nil, bundle: nil) | |
} | |
@available(*, unavailable, | |
message: "Loading this view controller from a nib is unsupported in favor of initializer dependency injection." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://developer.apple.com/library/content/samplecode/TableSearch_UISearchController/Introduction/Intro.html | |
// MARK: - UISearchResultsUpdating | |
func updateSearchResults(for searchController: UISearchController) { | |
// Update the filtered array based on the search text. | |
let searchResults = products | |
// Strip out all the leading and trailing spaces. | |
let whitespaceCharacterSet = CharacterSet.whitespaces |