Questions tagged [uialertaction]

UIAlertAction object represents an action that can be taken when tapping a button in an alert. You use this class to configure information about a single action, including the title to display in the button, any styling information, and a handler to execute when the user taps the button. After creating an alert action object, add it to a UIAlertController object before displaying the corresponding alert to the user. Available in iOS 8.0 and later in UIKit.

A UIAlertAction object represents an action that can be taken when tapping a button in an alert. You use this class to configure information about a single action, including the title to display in the button, any styling information, and a handler to execute when the user taps the button. After creating an alert action object, add it to a UIAlertController object before displaying the corresponding alert to the user. Available in iOS 8.0 and later in UIKit. UIAlertAction

205 questions
3
votes
1 answer

Get select index of UIAlertAction with dynamic items

I am building a dynamic list of actions. When pressing an action I would like to jump to a section in a table view. For this I would like to know the selected index of the action and replace it on the code section: "inSection: 0". Any way of doing…
bashan
  • 3,572
  • 6
  • 41
  • 58
3
votes
1 answer

How to Change the UIAlertAction button Color in iOS?

I've a UIAlertController and I've a bunch of UIAlertAcion Buttons. Now I need to show one button with other Color rather than the same color. For Ex Button1 Button2 Button3 Button1 and button3 should be in blue and button2 should be in red. Is…
SUDHAKAR RAYAPUDI
  • 549
  • 1
  • 9
  • 18
3
votes
0 answers

UIAlertAction with style UIAlertActionStyleDestructive color from Red to Grey when disabled iOS 8

I can't change my UIAlertAction's UIAlertActionStyleDestructive color from red to grey when the action is disabled. Setting the UIAlertAction to disabled on iOS 9 changes the color to grey. On iOS 8 the color remains red.
JerryZhou
  • 4,566
  • 3
  • 37
  • 60
3
votes
4 answers

How to change font size and color of UIAlertAction in UIAlertController

In the image above how to change the font size and color of "Done", "Some Other action"? and how to change the font size and color of "title", and "message"? Thank you.
Ronaldo.K
  • 303
  • 1
  • 5
  • 13
2
votes
1 answer

Populating UIAlertController with UIAlertActions based on string array

I've got a string array called languages, and I want to create as many UIAlertActions in a UIAlertController as there are elements in the array. I don't know how large the array will be, as the user can add languages to the array using the add…
Tirna
  • 383
  • 1
  • 12
2
votes
1 answer

Is there a way to pass a closure to UIAlertAction that will return a String in Swift?

I'm trying to get more into the Swift Closure concept and I have this problem, I have the following UIAlertController method: public static func showSerialNumberAlertController(handler: @escaping (UIAlertAction) -> String?) { let…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
2
votes
1 answer

Prevent UIAlertController from dismissing on UIAlertAction

I am working on one of the application where i am promoting user for force update using UIAlertController in which i don't wanted to allow user to perform any activity until and unless he updates the application from AppStore. To achieve this i have…
Aman.Samghani
  • 2,151
  • 3
  • 12
  • 27
2
votes
0 answers

Change alert action background highlight while using UIAlertController

I'm trying to change the background highlight color for my alertcontroller. For eg in the below image, right now the default background highlight for a cell is light gray, I need to change it to some other color. I saw various post on changing the…
Francis F
  • 3,157
  • 3
  • 41
  • 79
2
votes
0 answers

iOS: How to set custom font to alert action (alert button) ?

I am able to set custom font for title and message of the alert but i am not able to set custom font for alert action / button. Is there a way to do so? Please help! Many thanks!!
LinhTran
  • 143
  • 1
  • 9
2
votes
2 answers

UIAlertView inside UIAlertAction in Swift 3.0 ?

Is it possible to add UIAlert view inside UIAlertAction ? Because when I tried to add UIAlert view inside UIAlertAction, it says "Warning: Attempt to present on whose view is not in the window hierarchy!" Here's my code. let myAlert =…
AlotJai
  • 147
  • 4
  • 18
2
votes
2 answers

Add Image in Alert Message box Title with Swift 3

I would like to add Share Image in alert message title instead of title text. How can I implement this with swift 3? let alertController = UIAlertController(title: "Share Movie", message: "Share this movie!", preferredStyle: .alert) …
May Phyu
  • 895
  • 3
  • 23
  • 47
2
votes
0 answers

How do I add the ability to make phone calls through a Right Callout Accessory View action button?

What I'm looking to do is when someone presses a the "Call Location" button via the UIAlertAction sequence below, I want it to load up the phone and dial a phone number I imputed earlier in the code (up in ViewDidLoad). This is my annotationView -…
2
votes
2 answers

UIAlertController action sheet whatsapp style

Does anyone knows how to create an UIAlertController like that one that whatsapp did in the next attachment (beside of creating custom UI)
Benny Davidovitz
  • 1,152
  • 15
  • 18
2
votes
1 answer

How to tint an UIImage in a UIAlertController

How can I create an UIAlertController with a cancel button and three other buttons with an icon? I am supporting iOS 8 upwards. Each entry should be tinted...
GatoCurioso
  • 225
  • 3
  • 11
2
votes
1 answer

Making a privacy policy in Swift: How to make UIAlertController action button disabled until message is scrolled to the bottom

In my iOS application I am trying to implement an easy privacy policy using a UIAlertController. By law, the policy has to be scrollable before it can be accepted - like most privacy policies these days. From my own research I have seen that you…
Danoram
  • 8,132
  • 12
  • 51
  • 71
1 2
3
13 14