Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to dismiss an alertview automatically after some time?

I'm looking for a way, to automatically dismiss an alert view after some time or after a task is done. Is there a possibility? (or another way to show a message for some time?)

like image 469
Daniel Avatar asked May 05 '10 16:05

Daniel


People also ask

How do I dismiss an alert?

1. From the Alerts tab, under Alerts, click Inbox. 2. On the Alerts Inbox page, click the check boxes in front of the alerts you want to dismiss, then click the Dismiss button.

How do you dismiss an alert with click on outside of the alert IOS?

Step 1 − Open Xcode and create a single view application and name it UIAlertSample. So basically, when we tap on the button an alert will be displayed, when the user taps outside the alert the alert will be dismissing.

How do I dismiss an alert in Swift?

You can dismiss the alert by calling dismissViewControllerAnimated method on alertController object.


1 Answers

You can call the -dismissWithClickedButtonIndex:animated: method to dismiss the alert view.

To dismiss it automatically, create an NSInvocation and then use -performSelector:withObject:afterDelay: to -invoke it.

like image 119
kennytm Avatar answered Oct 03 '22 15:10

kennytm