Created
January 29, 2018 21:39
-
-
Save olbrichj/58b94cc576b17c30869d352b1e142299 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Foundation | |
class UIOperation: AsyncOperation { | |
let viewController: UIViewcontroller! | |
override func execute() { | |
let alert = UIAlertController(title: "My Alert", message: @"This is an alert.", preferredStyle: .alert) | |
alert.addAction(UIAlertAction(title: "OK", style: .`default`, handler: { _ in | |
self.handleInput() | |
})) | |
viewController.present(alert, animated: true, completion: nil) | |
} | |
func handleInput() { | |
//do something and continue operation | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment