A Simple Customizable Alert With Swift
SimpleCustomizableAlert
trying to make my very first library.
Support
- Title
- Message (TextView)
- Image
- TextField
- Button Action
Example
let alert = SEAlertController(title: "Alert Title", message: "text text text text \n text text text")
alert.addImageContent(UIImage(named: "apitherapy"), 100)
let textField = UITextField()
textField.placeholder = "placeholder"
alert.addTextField(textField: textField)
alert.addAction(action: SEAlertAction(title: "textfield value", type: .normal, action: {
guard let fieldText = textField.text else { return }
print(fieldText)
}))
alert.addAction(action: SEAlertAction(title: "cancel", type: .cancel, action: {
print("cancel")
}))
self.present(alert, animated: true)