- Swift 5.1
- Xcode 10.1 or greater
- iOS 11 or greater
Douglas Nunes, [email protected]
let config = AlertViewBuilder()
Description | Default value |
---|---|
icon(_ image: UIImage?) | not value Default |
title(_ title: String?) | not value Default |
message(_ message: String?) | not value Default |
styledMessage(_ message: NSAttributedString?) | not value Default |
textAlign(_ alignment: NSTextAlignment) | .center |
tapDismiss(_ tap: Bool) | true |
enableVibrate(_ enable: Bool) | true |
cancelButtonTitle(_ title: String?) | not value Default |
doneButtonTitle(_ title: String?) | not value Default |
titleColorButtonDone(_ color: UIColor) | .white |
backgroundColorButtonDone(_ color: UIColor) | UIColor(red: 0.03, green: 0.31, blue: 0.62, alpha: 1) |
titleColorButtonCancel(_ color: UIColor) | .white |
backgroundColorButtonCancel(_ color: UIColor) | .red |
###Configuration file declaration
let config = AlertViewBuilder()
.title("Parceiro Ambev alerta!")
.textAlign(.center)
.tapDismiss(true)
.cancelButtonTitle("Cancel")
.doneButtonTitle("Confirm")
.build()
let alert = CustomAlertView()
AlertView component declaration with Button Cancel and Done.
alert.show(config: config,
doneAction: {
print("Click in Confirm")
}, cancelAction: {
print("Click in Cancel")
})
AlertView component declaration with Button Done.
alert.show(config: config,
doneAction: {
print("Click in Confirmar")
})