Skip to content

Instantly share code, notes, and snippets.

@olbrichj
Created January 29, 2018 21:39
Show Gist options
  • Save olbrichj/58b94cc576b17c30869d352b1e142299 to your computer and use it in GitHub Desktop.
Save olbrichj/58b94cc576b17c30869d352b1e142299 to your computer and use it in GitHub Desktop.
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