UAlertView
is deprecated in iOS 9 and later. What would be an alternative?
UIAlertView *new = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Your InApp Purchases were successfully restored" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[new show];
You can use this code to replace an alert view:
If you need multiple actions you can use:
You get often detailed information including the replacement suggestion by ⌘-clicking on the symbol which displays the class/method declaration.
In case of
UIAlertView
you will seeI made a category for that:
The parameters
aTitle
andaVC
are optional butaVC
should be used if known.PS: avoid the "new" as a variable name this is a reserved word, I actually don't know if it will compile though.
I have use "UIAlertController" on iOS 8 and later. Let see:
And add buttons:
Remember:
Then show it:
If you want to show a actionsheep, you change
UIAlertController has been around since iOS 8.