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

191 questions
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
  • 3,359
  • 3
  • 27
  • 44
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
  • 183
  • 1
  • 2
  • 13
2
votes
1 answer

SwiftUI: UIAlertController's textField does not responding in UIAlertAction

I need to use UIAlertContoller, as SwiftUI's Alert does not support TextField. I must not use Custom created AlertView, due to various reason(Accessibility, DynamicType, Dark Mode support etc). Basic Idea is, SwiftUI's alert must hold TextField &…
Nasir
  • 1,076
  • 1
  • 11
  • 30
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
  • 38,699
  • 35
  • 127
  • 177
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
  • 1,635
  • 2
  • 8
  • 21
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
  • 2,797
  • 3
  • 30
  • 75
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
  • 149
  • 4
  • 16
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,084
  • 12
  • 16
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
  • 6,985
  • 10
  • 45
  • 64
2
votes
1 answer

How to change the text of UIButton from ActionSheet

I want to change the text of UIButton city . But its not working, can you tell me whats the problem here? And this IBAction setUpCityDropDown is connected to same UIButton. @IBAction func setUpCityDropDown() { let ActionSheet =…
Ketul Patani
  • 91
  • 1
  • 8
2
votes
3 answers

How to change UIAlertController button color universally in ObjC

this question is similar to this But, instead of changing the color in every UIAlertController, I want to change it universal like 'AppDelegate'. So, If I change the color in one place, then all the alert controller action button should change to…
user5907771
2
votes
3 answers

How to present UIAlertController from SKScene

I'm working in Spritekit and I'm trying to present a UIAlertController from my SKScene, but I am having trouble doing it. I've watched several tutorials but none of the UIAlertController tutorials have been specific to Spritekit. I keep seeing this…
2
votes
0 answers

Adding arguments to UIAlertAction

I have 2 classes in separate files: lets call them NotificationManagement and NotificationReceiver in my NotificationReceiver class i have the following code: class NotificationReceiver: UIViewController{ //... func…
1 2
3
12 13