UIAlertController for swift
Alert(title: "Title", message: "Message")
.addAction("OK")
.show()
Alert(title: "Title", message: "Message")
.addAction("Accept", style: .default, handler: { (action) in
print("Accept action clicked")
})
.addAction("Cancel", style: .destructive, handler: { (action) in
print("Cancel action clicked")
})
.show()
var textField = UITextField()
Alert(title: "Title", message: "Message")
.addTextField(&textField, required: true)
.addAction("Ok", style: .default) { (action) in
}
.addAction("Cancel", style: .destructive) { (action) in
}
.show()
ActionSheet(title: "Title", message: "Message")
.addAction("Google Maps", style: .default, handler: { (action) in
print("Google Maps action clicked")
})
.addAction("Apple Maps", style: .default, handler: { (action) in
print("Apple Maps action clicked")
})
.addAction("Cancel", style: .cancel, handler: { (action) in
print("Cancel action clicked")
})
.show()
- Swift version 4.2
- Xcode 10.0+
- Download and drop 'ATAlertController.swift' in your project.
- Pull requests are welcomed.
- ATAlertController is available under the MIT license. See the LICENSE file.
Swift, ActionSheet, AlertView, UIAlertViewController