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

How To Start An Online Cupcake Business

How To Start An Online Cupcake Business Cupcake is a niche market in the baking industry and the statistics says that the industry turnover is about $1.6 billion annually in the United States of America only. The most inspiring and encouraging factor to get in the Cupcake business is that you can start on a small scale from the comfort of your kitchen. The business is so lucrative that even the  Shark Tanks  are investing in them ! If you are contemplating on How to start a cupcake business online, Here are the points that you must keep in mind . Read more..... http://www.infigic.com/blog/how-to-start-an-online-cupcake-business/

This is what makes Laravel the best PHP framework

Laravel, with its clean and robust output, has rapidly become the most preferred PHP framework. The coding ease it offers along with the security features it carries has made it the most admired PHP framework on GitHub. But when you set out to hire Laravel developers , you must know everything that makes Laravel special. Knowing the strengths of Laravel will be one of the surest ways of getting something truly remarkable from Laravel. In the world of PHP development, you have some awesome options like Yii2, Symfony, CodeIgniter or Zend, here’s top 6 things that makes Laravel stand apart. 1. The MVC feature A web application has two faces: the logic code face and the aesthetic, user-friendly presentation face. It is important the two remain separate. Why? That’s because occasionally, you’ll want to change the looks of the web page. If you get the developer involved in such design alterations every time, you’re blocking the developer resources (which are generally considere...

How to Start an Online Boutique

Oftentimes, the tips on how to start an online boutique are so simplistic you’d think you’ll begin making big money in the next 24 hours. In other cases, these tips make the whole task look more difficult than building a nuclear reactor! Luckily, neither of these cases is true. You can plan, build, and operate profitably an online boutique without knowing a single line of code. Starting an online boutique is as easy – or as difficult – as starting any other business. The number of platforms, with specialized tools, makes opening an online boutique a great deal easier, but the hard work you need to put in remains the same as in any other business. Since everyone else has access to the all the tools and platforms as you do, your success is dependent on details, on how you’ve used these tools and how you’ve deployed the technology therein rather than the tools. The better you understand things, from  eCommerce website development  to the legalities, the easier your jou...