Working with UIAlertView class in iOS @techytube
Working with UIAlertView class in iOS  @techytube
Uploaded October 2012 | Updated September 2026, 2 weeks ago
Subscribe to our channel here for notifications on new video trainings. For more videos on technology, visit our website at http://www.techytube.com.
By pavel@techytube, for more from this author visit:
techytube.com/author/pavel

When we want our app to display an alert message to the user we use the UIAlertView class.
Use the properties and methods defined in this class to set the title, message, and delegate of an alert view and configure the buttons. You must set a delegate if you add custom buttons. The delegate should conform to the UIAlertViewDelegate protocol. Use the show method to display an alert view once it is configured.

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

You have to show alert to the users only when it is absolutely necessary, which is also recommended by Apple's engineers.

In iOS 5 and up we have some additional customisation possibilities that we can apply to the UIAlertView objects. We achieve that by using its alertViewStyle property.

We have 4 options:

// the default one
alert.alertViewStyle = UIAlertViewStyleDefault;

// an alert with text input inside it
alert.alertViewStyle = UIAlertViewStylePlainTextInput;

// an alert with password-like text input inside it
alert.alertViewStyle = UIAlertViewStyleSecureTextInput;

// an alert with 2 text input fields - one for Login and one for Password
alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;


For more you can check Apple's Online Documentation at:
developer.apple.com/library/ios/#documentation/uikit/reference/UIAlertView_Class/UIAlertView/UIAlertView.html
Working with UIAlertView class in iOSWindows 7 vs Windows 8 Setup Speed ComparisonRestoring database backups Differential and Transaction Log Backups, Part 4Windows 8 - Surviving the upgrade. the keyboard shortcuts to knowWorking with UIAlertViewDelegate protocol methods in iOS.NET 3.5/WPF Creating A Splash ScreenWindows 8 Development - Application DataYum (Yellow Dog Updater Modified) Part 4 of 4Working with UIPickerView class in iOSWindows 8 Development - Javascript App Bar IIVMWare PowerCliVMWare vShield Agent
techytube |

Working with UIAlertView class in iOS

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER