i made app with swift and Xcode utilizing WordPress Web site to fetch information. i’m utilizing relaxation api to fetch information from Web site, my app is working nice on take a look at system however when i add it on app retailer after which it crashes, i discovered this error in my Xcode – organizer
that is how i implement searchbar
@IBOutlet weak var searchBar: UISearchBar!
in viewdid
searchBar.delegate = self
extension StatusViewController: UISearchBarDelegate {
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
self.searchBar.showsCancelButton = true
self.collectionView.reloadData()
}
func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
self.searchBar.textual content = ""
self.searchBar.showsCancelButton = false
self.searchBar.endEditing(true)
self.dismiss(animated: true, completion: nil)
SVProgressHUD.present()
sortBy = ""
web page = 1
self.fetchPostData { (posts) in
self.newsData = posts }
self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: true)
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
print("searchText (searchText)")
}
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
print("searchTextclicked (String(describing: searchBar.textual content))")
sortBy = "&search=" + searchBar.textual content!
web page = 1
self.fetchPostData { (posts) in
self.newsData = posts }
self.collectionView.isUserInteractionEnabled = false
SVProgressHUD.present()
self.collectionView.setContentOffset(CGPoint(x:0,y:0), animated: true)
refreshControl.endRefreshing()
self.searchBar.endEditing(true)
}
}
please are you able to inform me the difficulty ?