UIAlertViewController class is a replace of both UIAlertView and UIActionSheet. Basically this is a sub-classed from UIViewController, though it was sub-classed from UIViewController, as a developer you can't customise it as Apple was restricted to customise it.
The below code shows how to create UIAlertController object and how to display it to the message or alert to the user.
After implementing this the out put of the display will looks like below image
If you are interest in fetching data from textfields, you can write a helper function and call it from the alert button action.
Note: Incase if you want to display only alert message then, just ignore the textfields to adding it.
The same UIAlertController object can also be used to present action sheet by adding the following code block.
When you want to present a action sheet, you can't add UITextField object to UIAlertController object, incase if you add it to the UIAlertController your application gets crash.
The below code shows how to create UIAlertController object and how to display it to the message or alert to the user.
After implementing this the out put of the display will looks like below image
If you are interest in fetching data from textfields, you can write a helper function and call it from the alert button action.
Note: Incase if you want to display only alert message then, just ignore the textfields to adding it.
The same UIAlertController object can also be used to present action sheet by adding the following code block.
When you want to present a action sheet, you can't add UITextField object to UIAlertController object, incase if you add it to the UIAlertController your application gets crash.
0 Comments