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
0
votes
1 answer

No initializer for UIAlertAction (title, style, handler)

Dear Stackoverflowers, Can any experts on Swift/UIKit see what I'm doing wrong in the following screenshot? Xcode can't seem to find the convenience initializer for a UIAlertAction based on a title, style and handler, and I don't know of any other…
Jamie
  • 332
  • 1
  • 3
  • 14
0
votes
2 answers

Getting error on clicking button in swift

I am a newbie to iOS development and just started learning basic stuffs in swift. Now I am getting error while i try to run my basic coding that I am practising with Auto Layout. The below exceptions occurs while I try to open a dialog on clicking…
Chandru
  • 5,954
  • 11
  • 45
  • 85
0
votes
3 answers

Error when loading UIAlertController

I want to load an alert when internet connection is not available. The function for checking internet connection is ready but I cannot load the alert. So I just put the alert code in viewDidLoad without any conditions etc. and got this…
DeiForm
  • 701
  • 9
  • 31
0
votes
1 answer

UIPickerView within UIAlertController action sheet is not displaying any data

I'm trying to create a UIPickerView programmatically and display it's rows within an action sheet. However, nothing seems to be working. Here is a simplified example of similar non-working code: import UIKit class ViewController: UIViewController,…
Aaron
  • 6,466
  • 7
  • 37
  • 75
0
votes
1 answer

Swift - Use both UIAlertController & UIAlertView for iOS 7 / iOS 8 and above

My app's deployment target is 7.0 . I want to use both UIAlertController and UIAlertView. I read somewhere that checking for iOS versions is not good, so i used this code : if (NSClassFromString("UIAlertController") != nil) { // UIAlertController }…
SergeH
  • 608
  • 1
  • 5
  • 20
0
votes
1 answer

UIAlertController height difference

I have used UIAlertController for actionsheet,please look the images no.1 is old project and no.2 is new one which i have created newly. why the action sheet height is too differ? This is my code for both app which i'm using. what's wrong on this?.…
Gowtham
  • 117
  • 12
0
votes
1 answer

Swift UIAlertController file rename action

I am using Swift 2. This question relates to iOS9. In brief:- If the file rename button is clicked and the file name is still invalid then do I need to present the alert again or is there a smarter way of handling this? In full:- Saving a file…
simons
  • 2,374
  • 2
  • 18
  • 20
0
votes
0 answers

popViewController not working if previous controller has uialertcontroller swift

I am using alertcontroller with indicator in FirstViewController, and I use self.dismissViewControllerAnimate to dismiss it. Then in SecondViewController I use popViewController to return to FirstViewController but I can't go back to…
FH-
  • 133
  • 1
  • 9
0
votes
1 answer

Height UIAlertControler not heigh enough for UIDatePicker on iPhone

I want to add programmatically a modal UIAlertController with a UIDatePicker in it to pick a date in iOS 7. The picker works fine but the height of the UIAlertController is not heigh enough to show the date picker. Solving this is probably very…
Olivier de Jonge
  • 1,454
  • 2
  • 15
  • 31
0
votes
1 answer

Change title of button

I have an alertController with a button in it. Here's how I created the button: var myButton : UIAlertAction! // Later... self.myButton = UIAlertAction(title: "myButton", style: .Default, handler: {action -> Void in self.myButton.title =…
Jessica
  • 9,379
  • 14
  • 65
  • 136
0
votes
2 answers

How to use UIAlertController inside UITableViewCell

How can I use an UIAlertController inside a TableViewCell? Gives me an error does not have a member called "presentViewController". My TableViewController is named "OrdensCompraTableViewController" My function: @IBAction func…
Renato Pimpão
  • 271
  • 3
  • 17
0
votes
1 answer

How can I show UIAlertController on top of all the other views from UIPopoverController?

I am trying to show UIAlertController view while UIPopoverController view is open, but the alert view goes back of popover view like this. How can I make the alert view to the foremost of the window? Here is my code. Thank you. UIAlertController…
0
votes
1 answer

UIActivityViewController or UIAlertController cannot be cancelled

I am trying to share a URL using UIActivityViewController as shown below. This presents fine, but cannot be cancelled, i.e. tapping the cancel button does nothing. This is only within my app. If I create a test app with a view controller embedded in…
Ants
  • 1,338
  • 16
  • 27
0
votes
1 answer

UIAlertController error when testing using iPhone device (Thread 1: EXC_BAD_ACCESS) iOs SWIFT

This is a weird and frustrating problem because these codes work on my friends computer and iPhone device when i asked him to test it, but it does not work on my computer and iPhone 4. The error is called "Thread 1:…
oscar
  • 11
  • 2
0
votes
2 answers

How to perform another UIViewController above an UIAlertController?

I have tried to call [alertController presentViewController:anotherVC animated:YES]. It works, but not well. The buttons in anotherVC are in grey colour, although they can still handle clicks. And, after dismissing anotherVC, alertController is not…
zhoudu
  • 623
  • 8
  • 19
1 2 3
99
100