SCLAlertView-Swift icon indicating copy to clipboard operation
SCLAlertView-Swift copied to clipboard

programmatically dismiss an alert?

Open galileomd opened this issue 9 years ago • 3 comments

is there a way to programmatically dismiss an alert? not autodismiss, we have an external trigger we capture and would like the alert to respond as well.

galileomd avatar Jul 18 '16 16:07 galileomd

The various show... methods (showTitle, showError, etc) return an instance of SCLAlertViewResponder. Store that object and call its close method when you want to dismiss the alert.

etherboy avatar Jul 28 '16 21:07 etherboy

let alert = SCLAlertView()
alert.hideView() 

Dev- avatar Oct 19 '16 13:10 Dev-

Hi all, can we now close this? Just dropping by to tell you all that I've spent like 2 nights dismissing the alert. I've been tracking my screen hierarchies, doing child.removeFromParentViewController(), alert.dismissViewController..... OMG. Maybe we should include this hideView() in the documentation? Thanks.

glennposadas avatar Aug 25 '17 17:08 glennposadas