TVAlert's usage is the same as UIAlertController
. Just replace UI
with TV
on both UIAlertController
and UIAlertAction
let alertController = TVAlertController(title: "Title", message: "Message", preferredStyle: .alert)
alertController.style = style
let OKAction = TVAlertAction(title: "OK", style: .default) { (action) in
// ...
}
alertController.addAction(OKAction)
let cancelAction = TVAlertAction(title: "Cancel", style: .cancel) { (action) in
// ...
}
alertController.addAction(cancelAction)
self.present(alertController, animated: true) {
// ...
}
TVAlert is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TVAlert"
Austin Drummond, adrum0x7@gmail.com
TVAlert is available under the MIT license. See the LICENSE file for more info.