UISearchBar detect when user stop type in swift
问题 Most of the example I found is in Objective - C which is very hard for me to understand can someone provide an example regarding this question in Swift . Here is one solution but it is in Objective C . 回答1: func searchBar(searchBar: UISearchBar, textDidChange searchText: String) { print("after every text gets changed") timer.invalidate() timer = NSTimer.scheduledTimerWithTimeInterval(5, target: self, selector: #selector(ViewController.output), userInfo: searchText, repeats: false) } func