0

I a built a UIAlertController with two text fields. I am wondering how I can some space between them...see screenshot.

Here is my code defining UIAlertController and the my 2 text fields.

let alertController: UIAlertController = UIAlertController(title: "Property Type", message: "", preferredStyle: .alert)

        alertController.view.tintColor = UIColor(displayP3Red: 30.0 / 255.0, green: 53.0 / 255.0, blue: 94.0 / 255.0, alpha: 1.0)

        alertController.addTextField { (textField) -> Void in
            self.propertyTextField = textField
            self.propertyTextField.delegate = self
            self.propertyTextField.placeholder = "Please enter a property type"
        }

        alertController.addTextField { (textField) -> Void in
            self.unitPropertyTextField = textField
            self.unitPropertyTextField.delegate = self
            self.unitPropertyTextField.placeholder = "Please enter a unit number (if applicable)"
        }

Here is the screenshot

enter image description here

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user979331
  • 11,039
  • 73
  • 223
  • 418
  • You can't customize the textfields. (duplicate) https://stackoverflow.com/questions/45758565/custom-textfield-in-uialertcontroller – Lirik Aug 01 '19 at 15:19

1 Answers1

0

You can't customize the textfield placement in Apple's UIAlertController. But you might be interested in using a custom AlertController like SCAlertView-Swift.

Your other option, if you really desire to have this feature, is to probably make your own version of the UIAlertController

Alan S
  • 594
  • 3
  • 13