From 81d1935b206d3f0df2738b3b5a1d32af9f2dcece Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Sat, 29 Aug 2015 23:19:44 -0700 Subject: [PATCH] Fixed iOS 9 deprecation warnings in PFAlertView, PFPushUtilities. --- Parse/Internal/PFAlertView.m | 8 ++++++-- Parse/Internal/Push/Utilites/PFPushUtilities.m | 13 ++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Parse/Internal/PFAlertView.m b/Parse/Internal/PFAlertView.m index 26804d6c3..119537b95 100644 --- a/Parse/Internal/PFAlertView.m +++ b/Parse/Internal/PFAlertView.m @@ -9,8 +9,6 @@ #import "PFAlertView.h" -#import - @interface PFAlertView () @property (nonatomic, copy) PFAlertViewCompletion completion; @@ -62,6 +60,7 @@ + (void)showAlertWithTitle:(NSString *)title [viewController presentViewController:alertController animated:YES completion:nil]; } else { +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0 __block PFAlertView *pfAlertView = [[self alloc] init]; UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title message:message @@ -83,9 +82,12 @@ + (void)showAlertWithTitle:(NSString *)title alertView.delegate = pfAlertView; [alertView show]; +#endif } } +#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0 + ///-------------------------------------- #pragma mark - UIAlertViewDelegate ///-------------------------------------- @@ -100,4 +102,6 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto } } +#endif + @end diff --git a/Parse/Internal/Push/Utilites/PFPushUtilities.m b/Parse/Internal/Push/Utilites/PFPushUtilities.m index e12e9892c..e3f04fcac 100644 --- a/Parse/Internal/Push/Utilites/PFPushUtilities.m +++ b/Parse/Internal/Push/Utilites/PFPushUtilities.m @@ -12,9 +12,9 @@ #import #if TARGET_OS_IPHONE - #import +#import "PFAlertView.h" #endif #import "PFInstallationPrivate.h" @@ -60,12 +60,11 @@ + (void)showAlertViewWithTitle:(NSString *)title message:(NSString *)message { NSString *cancelButtonTitle = NSLocalizedStringFromTableInBundle(@"OK", @"Parse", [NSBundle bundleForClass:[self class]], @"Default alert view cancel button title."); - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title - message:message - delegate:nil - cancelButtonTitle:cancelButtonTitle - otherButtonTitles:nil]; - [alert show]; + [PFAlertView showAlertWithTitle:title + message:message + cancelButtonTitle:cancelButtonTitle + otherButtonTitles:nil + completion:nil]; } + (void)playAudioWithName:(NSString *)audioFileName {