1,691 questions
-1
votes
0
answers
66
views
What is new text color in UIAlertController
For UIAlertController
In iOS version < 26, text color was Black for title and message.
In iOS version = 26, text color of title is black. What is font/color of message label?
Please see below ...
-4
votes
2
answers
175
views
I can't quite work out how to extend a view controller with an async alert controller
Note that you very likely would NOT do this in a production app as continuations easily leak. (Although it is incredibly useful during development.)
I'm trying to write an asynchronous alert that ...
-1
votes
1
answer
66
views
How to show an alert after moving to the next view controller?
I'm using this code to call MFMailComposeViewController from another class:
SomeViewController:
class SomeController: UIViewController {
func contactWithDeveloper() {
let detailController =...
0
votes
0
answers
29
views
UIProgressView not updating progress [duplicate]
Simple question, here's the code snippet in question:
override func viewDidLoad() {
tableView.sectionHeaderHeight = 0
self.navigationController?.isNavigationBarHidden = true
self....
0
votes
0
answers
43
views
Issue in Accessibility run of UIAlertController
I have a project in which I am using UIAlertController at some places. whenever I am doing accessibility testing the alert is shown on screen, and I get warnings in accessibility inspector for title, ...
0
votes
0
answers
39
views
Is there a way to automatically set subview height of UIAlertController?
I created a stackView which includes two UILabels, then add this view to UIAlertController.view by function addSubview(), for insteading of uialertcontroller's title and message by special styles. now ...
1
vote
1
answer
76
views
How to change UIAlertAction's image position?
I want to create a popover menu with UIAlertController which includes customize action items, user can define style like font-size , background-color, alignment and Icon Position (Leading / Trailing), ...
0
votes
2
answers
522
views
How to programmatically take a screenshot of an app in iOS with UIAlertController as the top controller?
extension UIViewController {
static func takeScreenshot() -> UIImage? {
guard let topController = UIApplication.getTopController() else { return nil }
if let view = ...
1
vote
1
answer
209
views
UIAlertController with textfield compressed in landscape mode
I found this problem in working project. After I've created the simplest UIAlertController with textfield in empty project and found same problem. Looks like system bug?
How to reproduce: Launch code ...
0
votes
0
answers
53
views
How to set custom font for UIAlertController [duplicate]
Able to set font for alert title and alert message but not for the Ok alert button.
Want to set the font for the Ok also, Thanks in advance.
let alertController = UIAlertController(title: ...
3
votes
1
answer
66
views
Is an empty subclass of UIAlertController safe for use with `appearance(whenContainedInInstancesOf:)`
Somebody here on SO wanted to alter the behavior of UIAlertAction buttons in a specific UIAlertController, but not others. (They wanted multi-line button labels for one alert but normal behavior for ...
0
votes
1
answer
98
views
Set numberOfLines for specific UIAlertController (not all of them)
I was having issues with text truncating with UIAlertController but that issue is fixed now with:
UILabel.appearance(whenContainedInInstancesOf: [UIAlertController.self]).numberOfLines = 2
This will ...
0
votes
2
answers
334
views
Can I present a toast when alert is also presented?
Do you know if it's possible to present a toast message while alert is presented?
More specific, the alert contains a textfield and I want to present a toast with error message when textfield's value ...
1
vote
0
answers
55
views
How can I change the size of a UITextField?
I want to change the size of the UITextField programmatically.
Actually what I want to do exactly is this UIAlertView inside I have a UITextField. I want to increase the size of this UITextField.
...
0
votes
0
answers
69
views
Different background colour on Cancel action of UIAlertController with actionSheet style
I have a UIAlertController with preferred style actionSheet and a cancel action with cancel style. The issue I have is that as you can see from the image below, the background colour of the cancel ...
0
votes
0
answers
196
views
SwiftUI Custom Alert action block does not execute
I want to achieve an alert that has a text field embedded in it WITHOUT the help of iOS 16. It went smoothly until I wanted to update a variable when I press one of the buttons.
Currently, I have the ...
0
votes
1
answer
115
views
UIAlertController: Check if there's text in multiple UITextFields before button is pressed
Swift 5, Xcode 14.2
I've got two UIViewControllers that both have to display the same UIAlertController (only one is loaded at a time). Instead of using the same code twice, I added it to my existing ...
0
votes
1
answer
778
views
How to remove alert view button in SwiftUI
I have scenario where I need to display an alert without any button. Is it possible to remove the buttons from the default Alert in SwiftUI?
I know how to create a custom view as Alert. But I would ...
0
votes
1
answer
637
views
SwiftUI Alert with Picker
I'm trying to create a SwiftUI alert dialog that contains a picker view inside of it, similar to the example here https://github.com/zhiyao92/PickerView-on-AlertController.
This is the code I've built ...
0
votes
1
answer
42
views
Nested UiAlerts - Show alert in UIAlert Action
I would like to present a second UIAlertController in UIAlertAction. The second UIAlertController is called by method 'deletePoints'. The problem is that the first action does not wait for the second ...
0
votes
1
answer
51
views
Is there a way in Swift to match my button width with my textfield inside of my alertView?
returnAlert?.addTextField(configurationHandler: { [self] (textField) in
// //Dropdown Start here
let customDiscounTypes:[String] = ["\(PaymentCardType.MasterCard)", "\(...
0
votes
1
answer
39
views
compose Alert textFields first text
I have a table view and I have an add button that when pressed alerts three text fields to pop up when you finished and press add the data goes into the table view and is stored in Firebase.
let ...
0
votes
1
answer
64
views
Alerts Not Showing Up On Phone Screen when Testing App
I am currently working on a social media app and so far I have been able to make a LoginViewController & a SignUpVIewController, and have it where when the user taps on the Sihn Up Button on the ...
7
votes
1
answer
4k
views
UICollectionViewCell translatesAutoresizingMaskIntoConstraints property warning (iOS 16+, Xcode 14.2)
I am getting an odd compiler message when presenting a totally innocuous alert controller from a tableViewController:
let ac = UIAlertController(title: "Add item", message: nil, ...
0
votes
1
answer
5k
views
Call must be made on main thread i can get the data but when i want it to show error message it crashes
StartScreenVC
import UIKit
class StartScreenVC: UIViewController {
private var apiService = ApiService()
override func viewDidLoad() {
super.viewDidLoad()
...
1
vote
0
answers
113
views
addTextField to an alert using UIAlertController error
I am trying to add a text field to an alert to simply ask a user for their name which I will then store as a variable and then use.
However when I add the text field I keep getting this error:
[...
0
votes
0
answers
175
views
iOS 16 - UI bug when keyboard showing while UIAlertController is presenting
I have a problem that appears on my iOS app since iOS 16.
I have a UIAlertController presenting and when the keyboard appears, on iOS < 16 the keyboard is showing in front of the UIAlertController, ...
0
votes
2
answers
827
views
Dismissal of UIAlertController inside async function
i am struggeling with a issue as following:
i start some network processing inside a async function:
func upload(
object: object,
context: NSManagedObjectContext
) async -> Dictionary<...
0
votes
0
answers
48
views
Swift UIKit / presenting UIAlert blocks pushing VC
I got simple UIViewController + UIAlert extension:
extension UIViewController {
func alert(title: String = "", message: String){
let alert = UIAlertController(title: title, ...
0
votes
1
answer
55
views
How do you use for loop to test code in UIAlertAction
I am trying to use UIAlertAction to have a user enter in a name and check that name against an array of names. If the name exists I want to notify the user and return to the UIAlertcontroller. If the ...
-2
votes
1
answer
97
views
How to put a success or error alert inside an options alert?
I have a problem trying to put an alert message after completing the action. The application crashes.
@IBAction func deleteAccountAction(_ sender: Any) {
let userID = prefs.value(forKey: "...
0
votes
1
answer
180
views
UIAlertAction handler/closure does not execute
I have an UIViewController extension which I am using to display alerts in any view controller. It worked fine until this weird use case happened:
extension UIViewController {
func showModal(title:...
0
votes
1
answer
390
views
UIAlertController Alert action TextField need to be resized-error
Getting this error...
[LayoutConstraints] Changing the translatesAutoresizingMaskIntoConstraints property of a UICollectionViewCell that is managed by a UICollectionView is not supported, and will ...
3
votes
0
answers
495
views
SwiftUI Alert not presenting in View contained in UIHostingController in iOS14?
I have a SwiftUI View that is presented by UIKit and is contained within a UIHostingController. This View has a button that should trigger an Alert to be presented. My implementation is ...
2
votes
0
answers
139
views
iPad physical keyboard Return key doesn't dismiss my UIAlertControllers correctly
I am working to give my app better support for the iPad physical keyboard. Everything is behaving pretty much as expected, except the keyboard's Return key is not dismissing UIAlertControllers that do ...
1
vote
1
answer
2k
views
Swift UIKit - Showing an alert after another one
I am trying to show an alert after another one in swift. I found a solution but I think this is not the true way. My code piece is below.
With this code, alerts can be shown in the view.
override func ...
0
votes
2
answers
60
views
How do i reach indexPath in a custom func?
I am trying to open a second UIAlertController upon choosing an option in the first UIAlertController but I am unable to reach indexPath in order to set a property from a textField of a second ...
2
votes
1
answer
706
views
Cannot find system alert using Xcode Tests
How do you tap on "OK" on the iOS system alert asking "Photos access" using Xcode Tests?
There are many many such questions on SO, but none of the answers worked for me.
Tests ...
1
vote
1
answer
60
views
TableView won't populate
I've added a UITableView control to a UIAlertController to create a custom list picker. Everything worked fine until I tried to move all of my code into a new ListPicker class. Originally I had this ...
0
votes
1
answer
842
views
How to change UITextField Font size within an Alert
I'm trying to make my font size larger in the textField that is currently placed within an alert:
func showAlert() {
let ac = UIAlertController(title: "Title", message: "Message&...
2
votes
0
answers
434
views
Swift: UIAlertController in SwiftUI sheet bug
I would like to include UIAlertController in my SwiftUI project because I have more customization options with UIAlertController than with swiftui alert. I've already partially done that with this ...
1
vote
1
answer
118
views
UIAlert disappears when the page is change
I have to show an UI alert dialog in the Appdelegate and MainAcvitivy in Xamarin.Forms. For android, there is no problem but for ios it does not work properly.
First of all, if I use UIAlertView, it ...
0
votes
1
answer
478
views
Why is my alert controller not dismissing in my Swift app?
I have a custom view controller class which presents an alert controller when it receives a not connected notification from my network services class. I want to dismiss the alert controller when I ...
0
votes
1
answer
844
views
How to set width/height of iOS UIAlertController
I've been trying to figure out how to change the height and width of the UIAlertControllerfor a couple of weeks now. You apparently can do it as I've seen several Swift examples, for example here. I ...
0
votes
1
answer
361
views
Not able to call a method in AlertController
I'm trying to upload a file only if the user clicks on 'Yes', it is not calling the method but
new to ionic so I'm not sure if this is right way to call a method in Alert.
async presentAlertConfirm() ...
0
votes
1
answer
198
views
How to set background color in UIAlertController
I'm trying to set the background color of a UIAlertController. The code I'm using appears to (almost) do that except it looks more like Tint than BackgroundColor. The corners are the color I'm ...
0
votes
1
answer
111
views
How can I make UIAlertController appear over the top of anything and everything?
I am developing an app using Visual Studio 2022 that uses ZXing.Net.Mobile,Forms to scan barcodes, everything is working as expected except I am unable to display the UIAlertController message over ...
0
votes
1
answer
606
views
Adding a redirection link to an AlertController button
(Angular & Ionic)
I would like to add a link to the playstore from my alertcontoller modal. is this possible?
const alert = this.alrtCrtl.create({
title: `...`,
subTitle: `...`,
...
-2
votes
1
answer
654
views
UIAlertController shown on iPhone, not on iPad
I'm presenting a UIAlertController action sheet on a view controller. This works fine on an iPhone. On an iPad I see nothing, but the console warns me about layout constraints which seem to set its ...
0
votes
1
answer
108
views
How to get the UIAction's position on the screen?
In the below UI, I need to show Spotlight where we are going to show some feature of the button from UIAlertController.
So to add a mask to the UIWindow for that button I need it's exact location.
How ...