Questions tagged [uialertcontroller]

An iOS class, for displaying alerts and popup style selectors. Note that the legacy `UIActionSheet` and `UIAlertView` tags would not generally be used now.

In iOS, UIAlertController displays an alert message to the user, or, an action selector. (On iPhone, it's the large selector which appears from the bottom of the screen, usually with two or three choices.)

After configuration, it is presented using UIViewController.present. In the action sheet case, actions are added using UIAlertController.addAction.

This class replaced the older UIActionSheet and UIAlertView.

Apple UIAlertController Documentation

1683 questions
16
votes
8 answers

"Please wait" dialog in iOS8

I used to have a "Please wait" dialog in my app for long time. It was quite simple thing using UIActivityIndicatorView and adding it to UIAlertView. However iOS8 introduced UIAlertController. Is it possible to add anything to it to have similiar…
matrejek
  • 400
  • 1
  • 4
  • 15
15
votes
3 answers

How to customize UIAlertController with UITableView or is there any default control available like this UI in Pages app?

I would like to implement a UIAlertViewController like this (Reference: Pages and Keynote app): . I have implemented a custom tableview and presented the view by mimicking the UIAlertViewController. But I cannot achieve a similar UI as above. Is…
SMS
  • 558
  • 1
  • 9
  • 22
15
votes
4 answers

How to add Progress bar to UIAlertController?

I want to add progress bar in swift iOS 8 UIAlertController. Is this possible? Is there any way to subclass UIAlertController and add progres bar and connect some delegate functions? thanks
Nik
  • 1,517
  • 5
  • 14
  • 19
15
votes
8 answers

How to dismiss an UIAlertController and the keyboard simultaneously?

I have created a signup form with a UIAlertController and used the method addTextFieldWithConfigurationHandler to add a text field. But there is a little problem. When the form shows up, the keyboard and modal appear with a smooth animation. When…
Thons
  • 285
  • 2
  • 8
14
votes
7 answers

Adding an image to a UIAlertController

This is my alert that works perfectly. I want to add an image to the alert that shows up along side the text when the alert is presented and I'm in an SKScene in SpriteKit if it makes a difference. var alertController = UIAlertController(title: "How…
user5349223
14
votes
2 answers

UIAlertAction completion block not called - iOS

I have an iOS app with a UIAlertController in the form of a action sheet being presented in my app when the user taps on a button. It all works great, apart from one thing, the completion blocks don't get called for some reason. Here is my code: //…
Supertecnoboff
  • 6,406
  • 11
  • 57
  • 98
14
votes
4 answers

Swift Attempt to present UIAlertController whose view is not in the window hierarchy (presented after TWTRShareEmailViewController)

I'm using the Twitter login in the signup process of my app. And I'm asking for the user's email. Once I get it, I'd like to present a UIAlertController. Here's my code: func askForTWMail(){ if (Twitter.sharedInstance().session() != nil) { …
Marie Dm
  • 2,637
  • 3
  • 24
  • 43
14
votes
2 answers

KEEP keyboard ON when UIAlertcontroller is presented in Swift?

When the alert pops up the keyboard is dismissed. I have looked everywhere but did not find solutions to keep the keyboard visible. When alert is presented the textfield seems to resign first responder automatically as the alert is presented…
Sam
  • 1,101
  • 2
  • 13
  • 26
14
votes
1 answer

Presenting UIAlertController ActionSheet in popover on iPhone

I'm creating and presenting an ActionSheet as follows: let alertController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet) alertController.modalPresentationStyle = .Popover // Add some…
Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
13
votes
3 answers

How do I handle the actions of a UIAlertController?

How can I link UIAlertController alert action buttons with action handlers using objective-c? I'm using Xcode 7.1. Here is my code: - (IBAction)selectbtn:(UIButton *)sender { UIAlertController *alert=[ UIAlertController…
ghoshghosh
  • 196
  • 1
  • 1
  • 9
13
votes
4 answers

Trigger UIAlertAction on UIAlertController programmatically?

There are a couple of existing questions on this topic but they aren't quite what I'm after. I've written a little Swift app rating prompt for my app which presents two UIAlertController instances, one triggered by the other. I'm now trying to unit…
Luke
  • 9,512
  • 15
  • 82
  • 146
13
votes
2 answers

How to dismiss a UIViewController from a UIAlertController's UIAlertAction handler?

I would like to present a simple UIAlertController to the user with one of the options triggering the closing of the parent view controller. Here is the code that I am using: let alert = UIAlertController(title: title, message: message,…
Chris Balavessov
  • 805
  • 8
  • 14
13
votes
6 answers

Enable UIAlertAction of UIAlertController only after input is validated

I am using a UIAlertController to present a dialog with a UITextField and one UIAlertAction button labeled "Ok". How do I disable the button until a number of characters (say 5 characters) are input into the UITextField?
saintjab
  • 1,626
  • 20
  • 31
12
votes
6 answers

UIAlertAction Button Text Alignment Left

I want to align UIAlertAction text alignment to Left and add the icon as in image shown. I spent lot of time on google to get the solution but not found the right answer. Every body post for the alert title not for the alert action title. Please…
Ashu
  • 3,373
  • 38
  • 34
12
votes
4 answers

Change UIAlertController message or title during its presentation

Is posible change the title or message text of UIAlertController while its ViewController is presenting. For example I present an alert when a user press a button with this message: "Waiting for redeem code" Then I use Alamofire to make a request…