Skip to main content

How to use UIAlertView for iOS8 and above


In iOS 8 and above UIAlertView is deprecated so you can’t use UIAlertView in your beloved application. Apple has recently introduced new UIAlertController instead of UIAlertView. In this blog we would like to share how you can use UIAlertView both (with and without buttons) for iOS8 and above.

UIAlertController * alert=   [UIAlertController
                               alertControllerWithTitle:@"Rate AppRateDemoProject"
                               message:@"If you enjoy AppRateDemoProject would you mind taking a moment to rate it?"
                               preferredStyle:UIAlertControllerStyleAlert];

[self presentViewController:alert animated:YES completion:nil];


To add button in UIAlertController enter the following code.

UIAlertController * alert=   [UIAlertController
                                alertControllerWithTitle:@"Rate AppRateDemoProject"
                                message:@"If you enjoy AppRateDemoProject would you mind taking a moment to rate it?"
                                preferredStyle:UIAlertControllerStyleAlert];

  UIAlertAction* Btn1 = [UIAlertAction
                       actionWithTitle:@"Remind Me Later"
                       style:UIAlertActionStyleDefault
                       handler:^(UIAlertAction * action)
                       {
                           [alert dismissViewControllerAnimated:YES completion:nil];

                       }];

UIAlertAction* Btn2 = [UIAlertAction
                       actionWithTitle:@"Rate It now"
                       style:UIAlertActionStyleDefault
                       handler:^(UIAlertAction * action)
                       {
                           [alert dismissViewControllerAnimated:YES completion:nil];

                       }];

  UIAlertAction* cancelBtn= [UIAlertAction
                           actionWithTitle:@"No Thanks"
                          style:UIAlertActionStyleDefault
                          handler:^(UIAlertAction * action)
                          {
                              [alert dismissViewControllerAnimated:YES completion:nil];

                          }];

  [alert addAction:Btn1];

  [alert addAction:Btn2];
  [alert addAction:cancelBtn];

  [self presentViewController:alert animated:YES completion:nil];


 If you have any further doubts, drop us an email at info@infigic.com and we’ll get back to you with the best possible solution. Infigic is a  Mobile Application Development Company and we are always there to solve your queries. 

Comments

Popular posts from this blog

The Best Pharmacy Apps for 2019

When you can buy almost everything online, there’s no reason why you can’t buy medicines online. The steady growth in the number of apps to purchase medicine online shows how online businesses are adding convenience and comfort in one more area. And the growth is not surprising, considering that  the US spent over $450 billion on medicines in 2016 . Even a small piece of the pie in the business to serve customers who buy medicine online is big business. A pharmacy delivery app brings a number of benefits to everyone, from pharmacies to patients. Some benefits like ease of purchase or competitively priced products are quite obvious. However, these apps are capable of adding a lot of value to users. From helping people fix consultation appointments to publishing health blogs, these apps are offering an almost 360-degree service that physical visits to local pharmacies cannot. Little wonder that most  physical retail pharmacies  are adding mobile apps with which t...

How To Start An Online Grocery Store

If you are thinking of starting an online grocery store….. ….there’s this vital bit of statistics: Accenture estimates that by 2020, out of the total retail consumption by shoppers worldwide, eCommerce will get 13.5%. In other words, out of every 7 dollars spent on retail consumption, eCommerce will get a little over 1 dollar. Gold rush. Isn’t it ? Add to it the fact that there’s practically no way you don’t buy grocery – whatever the channel of purchase – you have a promising grocery market. And yet, people planning to get into the business of online grocery store often think the market is the same as that of an e-retailers…. …….That’s incorrect. Beyond some superficial similarities the two businesses share, at an operational level, they are entirely different. For instance, an online grocery store deals with items that are perishable in nature, unlike an e-retailer who faces no such risks.  As a result, when you are trying to figure out how to start an online gr...

Wordpress to Laravel

Overview Client has decided to switch his business website from Wordpress to Laravel or similar PHP framework. Client wants to have latest technology services associate with his business website. Challenge Challenge faced while development was incorporating forum, blogs, job board and online Store in single website. Definitely it was a switch from Wordpress to Laravel that took some time to understand old one and transform it to new one. Client also required an admin panel to customize things on his own website. Result Infigic understood the requirements thoroughly. Infigic developed a Laravel based website. Website has a forum for various discussions to takes place among the users. There is a job board which notify you about various jobs for you to take part. Client  liked the new look and interface of  Laravel Website. Features: Forum Blog with articles Job Board Listings ( For Health Professionals) Basic Online Store Basic Admin Pa...