Closed mukulm24 closed 7 years ago
Don't know if this is the right way to do it. But I usually use the showCustomSubview example to create my own button:
func showCustomSubview() {
alert = SCLAlertView(appearance: appearance)
alert.showInfo("title")
// Customize your button
let confirmButton = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
// Change event listener to "tap" if needed
confirmButton.addTarget(self, action: #selector(self.onClickConfirmButton), for: .touchDown)
let subview = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)
subview.addSubview(confirmButton)
alert.customSubview = subview
}
func onClickConfirmButton() {
alert.hideView()
// do something
}
Include the following:
1.0.3
6.0
iPhone 6
Reproduction Steps
1.Create a SCLAlertView 2.Add a button to it
Expected Result
How do i change the properties of this button on its tap.
let changeButton = alert.addButton("Change Password") { //button clicked //change button color ( i cannot use change button as it is inside its own initializer.) any other way than adding target manually) //button operations
}
Actual Result
Tell us what could be improved: