KyoheiG3 / SimpleAlert

Customizable simple Alert and simple ActionSheet for Swift
MIT License
398 stars 45 forks source link

I cannot add any action when I tap the button #13

Closed lacusrinz closed 8 years ago

lacusrinz commented 8 years ago

How I can add my custom action such as validation when I click the button without dismiss the view

KyoheiG3 commented 8 years ago

Please add custom event to action button.

let action = SimpleAlert.Action(title: "custom", style: .Cancel)
alert.addAction(action)
action.button.removeTarget(nil, action: nil, forControlEvents: .AllEvents)
action.button.addTarget(self, action: Selector("customAction:"), forControlEvents: .TouchUpInside)
lacusrinz commented 8 years ago

Thank you, got it