I would like to send a request to server after a delay, but if user has changed state of UITextFiled
this request should be terminated. What I have now is
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
sessionManager.session.invalidateAndCancel()
APIModel().searchRequest()...
}
but it actually does not stop the request from getting to server. I guess I should use GDC
delay
to wait a second before sending request and then, if UITextField
changed, terminate it. But I could not find an example of this logic realisation.