I just upgraded my xcode8 to Swift 3 and I got this error:
Value of type 'DispatchQueue' has no member 'asynchronously'
in this line:
DispatchQueue.main.asynchronously(execute:
Here's the whole snippet:
DispatchQueue.main.asynchronously(execute: { //Display alert message with confirmation let myAlert = UIAlertController(title: "Alert", message:messageToDisplay, preferredStyle: UIAlertControllerStyle.Alert); let okAction = UIAlertAction(title:"OK", style:UIAlertActionStyle.Default){ action in self.dismissViewControllerAnimated(true, completion:nil); } myAlert.addAction(okAction) self.presentViewController(myAlert, animated:true, completion:nil); }); } } catch let error as NSError { print(error.localizedDescription) } } task.resume() } }
Recently, upgrading to Swift 3 gave me a lot of errors, they are automatically fixed, but this one will not be fixed on its own, and I do not know what to do.
swift swift3 xcode8
PHP Web Dev 101
source share