Appearance of UIAlertController

Appearance of UIAlertController

Content Index :

Appearance of UIAlertController
Tag : ios , By : Blaise Roth
Date : November 29 2020, 04:01 AM

it helps some times The simplest approach is: don't.
There is absolutely no need for you to feel confined to the use of UIAlertController and its simple default view appearance and content. It is nothing but a presented view controller, after all. That means that you can write your own presented view controller that looks and behaves almost like a UIAlertController and its view, except now you are in total charge of its content!

No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

UIAlertController : UICollectionViewFlowLayout is not defined warning every time I try to bringup a UIAlertcontroller

Tag : ios , By : user183526
Date : October 29 2020, 04:46 AM
I wish this helpful for you I am using a UIAlertController for taking user input and updating a table cell. Everytime when I try to create a alert, I get this following warning in console , You need to call
self.presentViewController(alertController, animated: true, completion: nil)

UIAlertController Giving error? Please Give the code for UIAlertController with Array of Strings As Buttons in Swift

Tag : ios , By : Jason Jennings
Date : March 29 2020, 07:55 AM
this one helps. First of all I going to explain you why this happen, you can see if you touch any of your buttons always the output result of the call of NSLog("%@",String(i)) is plLists.count - 1, this is because you're trying to set always the index of the for statement inside the closure of the actions you're adding. The variable is outside the scope of the closure.
The main problem is that always the reference retained inside the closure in your case is the last index of the array, because as you said is increased and finally when it finish is assigned the value.
func presentAction() {

    let alertA = UIAlertController(title: "PlayLists", message: "Select From PlayLists Below", preferredStyle: .ActionSheet)
    let action = UIAlertAction(title: "Cancel", style:  .Default, handler: nil)

    let plLists = ["List1", "List2", "List3", "List4"]
    for(var i = 0; i < plLists.count; i++) {
        alertA.addAction(UIAlertAction(title: plLists[i], style: .Default, handler: self.handlerForAction)) 

    self.presentViewController(alertA, animated: true, completion: nil)

func handlerForAction(action: UIAlertAction) {

UIBarButtonItem loses custom appearance attributes when UIAlertController is presented

Tag : ios , By : user165781
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I have a UIBarButtonItem in a UINavigationBar that has some custom appearance attributes (custom font, color). It appears normally most places throughout the app. , I reset the style after presenting the ActionSheet
UIAlertController *alertVC = ... 

[self presentViewController:alertVC animated:YES completion:^{
    [self.navigationItem.leftBarButtonItem setDefaultAppearanceForSpecificItem];
    [self.navigationItem.rightBarButtonItem setDefaultAppearanceForSpecificItem];
[self setTitleTextAttributes:@{
        NSFontAttributeName: [UIFont systemFontOfSize:14],
        NSForegroundColorAttributeName: [UIColor VKBlueColor]

How to get access to button placed on UIAlertController from handler of UITextField placed on UIAlertController?

Tag : ios , By : SpittingCAML
Date : March 29 2020, 07:55 AM
wish of those help Why don't you make an attribute of the UIAlertAction? I've changed your code:
class TVC_ProgramsList: UITableViewController {

  var enterNameAC = UIAlertController()
  let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)

  @IBAction func addpush(sender: UIBarButtonItem) {

  func addProgram() {
    enterNameAC = UIAlertController(title: "Adding program", message: "Enter program name", preferredStyle: UIAlertControllerStyle.Alert)
    enterNameAC.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil))
    enterNameAC.addTextFieldWithConfigurationHandler { (textField) -> Void in
        textField.placeholder = "Program name"
        textField.addTarget(self, action: #selector(TVC_ProgramsList.enterProgramNameAC_editingTextField), forControlEvents: UIControlEvents.AllEditingEvents)


    self.presentViewController(enterNameAC, animated: true, completion: nil)


  func enterProgramNameAC_editingTextField() {
    let programNameString = enterNameAC.textFields![0].text!
    // use okAction here 
    self.okAction.enabled = programNameString.characters.count > 0

-ms-appearance, -0-appearance, and appearance showing up as error in editor.

Tag : css , By : nhuser
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The five main browsers (Edge, Chrome, Firefox, Safari & Opera) use a mix of -moz-appearance and -webkit-appearance. It is not supported in IE. So what your editor is telling you here is not that they are necessarily wrong, just there is no point having them.
For some reason Edge uses -webkit-appearance instead of -ms-appearance
-webkit-appearance: none;
-moz-appearance: none;
 appearance: none;
Related Posts Related QUESTIONS :
  • iOS Unity Firebase Messenger Xcode Compile Error: FIRDynamicLinks
  • Firebase Storage Image Cache not updating SWIFT
  • unhandled js exception: application main has not been registered expo TestFlight
  • App freezes on IOS when navigate to another screen - React Navigation
  • How to create haptic feedback for a Button in SwiftUI?
  • How can I achieve automatic scrolling in my text view when text comes down to the keyboard level in Swift?
  • how to get the location with the CLLocationManager every 10 secondes?
  • Calling completion handler of a function from Timer selector function Swift
  • How to make SwiftUI view fullscreen?
  • RAM, JSC, Views, UI and JS usage table appearing whenever I launch my react native app. How to remove this table?
  • Change status bar background color using UIStatusBarManager
  • Should we make tapGesture component an IBAction or IBOutlet to capture the tap event?
  • Iframe automatically goes full screen using Ionic 3.9.2 on iOS
  • How to calculate score out of 1000 given some seconds (In Double)
  • How to calculate time (minutes) between two dates in swift?
  • There was problem loading requested app.it looks like you may be using LAN URL
  • Swift circular corners doesn't work properly on different screen sizes
  • How change .navigationBarTitle font in SwiftUI?
  • What happens if `MPSCNNConvolutionDataSource` protocol's `load` method return false?
  • Why does the UIBarButtonItem not show up when I create it with code?
  • How to prevent following view controller inheriting navigation view controller bar?
  • What does it mean when .xcodeproj files are shown in red in Xcode?
  • Xcode SwiftUI how to scroll the Preview Canvas?
  • Expand tableview and increase scrollview content size by an appropriate difference on clicking a button inside a table c
  • xcodebuild failed with return code: 65 - using CLI/Appcenter but no error messages
  • "'isDeveloperModeEnabled' is deprecated: This no longer needs to be set during development. " What is isDevelo
  • Right click in UIKit for Mac
  • How we Support Dark Mode in Current iOS App with iOS 13?
  • Security vulnerablility issue in ios mobile app
  • How to set a background color for the viewController in swiftUI?
  • SwiftUI : Segue navigation
  • iOS 13 Custom UISearchBar _searchField crash
  • USDZ models have holes in SceneKit but not QuickLook
  • Why does iOS Password Autofill not prompt to save password on keychain?
  • Pushing information to firebase after event is created(Firebase-Realtime-Database)
  • Xcode 11 Beta and Carthage bootstrap
  • How to change the status bar background color and text color on iOS 13?
  • Using Core Data with SwiftUI
  • How should I do to wait all the data downloaded completely and show on TableView?
  • Can we specify the number of rows that can be shown in each section of a collection view
  • Why sometimes completion handler not called?
  • Protocol 'View' can only be used as a generic constraint because it has Self or associated type requirements
  • In UIKit we can set label.numberOfLines = 0 when we do not know how many lines the text will take? What is the alternati
  • Swift ISO8601 format to Date returning fatal error
  • SwiftUI Login Page Layout
  • Xcode: Could not locate installed application. Install claimed to have succeeded, but application could not be found on
  • See the TestFlight crash log in the Xcode
  • Why does zero UIView's CALayer.speed stops UIAlertController's buttons from working?
  • Firestore collectionGroup query returns empty result
  • Modify text in SwiftUI
  • CNCopyCurrentNetworkInfo with iOS 13
  • WWDC 2019 - iOS13 April 2020 requirement
  • Nativescript IPhone X - How to "hide" home indicator behind two swipes to go to home screen
  • Should I use a singleton location manager in Swift?
  • Accessibility problem in reusable TableViewCell
  • Remove top line containing Done button from Keyboard Using Storyboard or in Swift
  • Swift Storyboard - Centring an Icon and multi-line text horizontally
  • viewDidAppear is delayed by 0.5 sec
  • Pass URL values to SecondView Controller WebView (WKWebView)
  • How to upload images faster on iOS, when using takePictureAsync?
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com