popup dialog box in Swift iOS

popup box in Swift iOS

Popup dialog box in Swift iOS was easy before, in case you’re wondering how it’s done now,  here is a simple code that works.

Apple is changing the development standards/method from time. For now this works,  but who knows for how long. Just copy the code and put it where it needs to go.


override func viewDidAppear(animated: Bool) {
var alert = UIAlertController(title: “Alert”, message: “Message”, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: “Click”, style: UIAlertActionStyle.Default, handler: nil))
alert.addTextFieldWithConfigurationHandler({(textField: UITextField!) in
textField.placeholder = “Enter text:”
textField.secureTextEntry = true
self.presentViewController(alert, animated: true, completion: nil)



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s