Warning: Attempt to present UIAlertController which is already presenting (null) (Swift)

Viewed 991

i downloaded a project from here https://github.com/bilalbhutta/IOSNearbyPlaces , i added the relative pods and now i'm trying to run it to see how it work, but when i go in the second viewController (where the user should find a nearby places near his position) this function is activated

func didReceiveResponse(response:QNearbyPlacesResponse?) -> Void {
    self.response = response
    if response?.status == "OK" {

        if let p = response?.places {
            places.append(contentsOf: p)
        }

        self.collectionView?.reloadData()
    } else {
        let alert = UIAlertController.init(title: "Error", message: "Unable to fetch nearby places", preferredStyle: .alert)
        alert.addAction(UIAlertAction.init(title: "Cancel", style: .cancel, handler: nil))
        alert.addAction(UIAlertAction.init(title: "Retry", style: .default, handler: { (action) in
            self.loadPlaces(true)
        }))
        present(alert, animated: true, completion: nil)
    }
    isLoading = false
}

and i get the message "Unable to fetch nearby places" , looking in the console i saw the warning: "Attempt to present UIAlertController which is already presenting (null)". Is this the problem that does not run the application correctly? how i can solve it? (i already looked about this warning but not find something useful)

0 Answers
Related