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 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...

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...

Which company is best for laravel development?

Infigic, is a leading IT company with 8+ years experience in the ecommerce domain. Infigic provides all types of development services from custom websites to mobile app development services. Infigic has highly experienced laravel development professionals who have executed projects right from Custom laravel development, API development to Laravel migration projects. Our focus is to   partner with customers as their product development partners and build products that are highly reliable and scalable  . With our strong experience in laravel development, Infigic proves to be the most preferred development partners for a lot of startups who are looking to build cutting edge products and solutions. For a reasonable online store, you can contact Infigic Digital Solutions which is an IT company who personally contact the client's to draw the plan to the website to get the most convenient yet fulfilled design. Do get in touch with them, for a reasonable yet professional...