Alert is a syntax sugar library of UIAlertController.
import Alert
Alert(title: "Title", message: "Message")
.addAction("OK") { _ in
print("ok")
}
.addAction("Cancel", style: .cancel) { _ in
print("cancel")
}
.present()
ActionSheet(title: "Title", message: "Message")
.addAction("OK") { _ in
print("ok")
}
.addAction("Cancel", style: .cancel) { _ in
print("cancel")
}
.presentingSource(view)
.present()
Alert(title: "Title", message: "Message")
.addAction("OK") { _ in
print("ok")
}
.addAction("Cancel", style: .cancel) { _ in
print("cancel")
}
.addTextField(configuration: { textField in
textField.placeholder = "E-mail"
}, textDidChanged: { alert, textField in
print(textField.text)
})
.addTextField(configuration: { textField in
textField.placeholder = "Password"
textField.isSecureTextEntry = true
})
.present()
github "tattn/Alert"
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Alert is released under the MIT license. See LICENSE for details.