Created
January 26, 2017 12:44
-
-
Save TheSwiftyCoder/4e4d56444c89c1020facf13c5b477a21 to your computer and use it in GitHub Desktop.
Unable to deallocate send right solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func createSettingsAlert(_ title: String, message: String) { | |
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) | |
alert.addAction(UIAlertAction(title: "Settings", style: UIAlertActionStyle.default, handler: { (UIAlertAction) in | |
// Use the DispatchQueue.main.async {} block to handle any would be background thread methods. | |
DispatchQueue.main.async { | |
if let appSettings = URL(string: UIApplicationOpenSettingsURLString) { | |
UIApplication.shared.open(appSettings, options: [:], completionHandler: nil) | |
} | |
} | |
})) | |
self.present(alert, animated: true, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment