Remove MXKAlert class use.

UIAlertController is directly used.
This commit is contained in:
Giom Foret
2017-07-14 16:41:25 +02:00
parent 130d999a26
commit 1e34aa5e1b
16 changed files with 2536 additions and 2160 deletions
+37 -38
View File
@@ -45,7 +45,7 @@
UnifiedSearchViewController *unifiedSearchViewController;
// Current alert (if any).
MXKAlert *currentAlert;
UIAlertController *currentAlert;
}
@property(nonatomic,getter=isHidden) BOOL hidden;
@@ -132,7 +132,7 @@
if (currentAlert)
{
[currentAlert dismiss:NO];
[currentAlert dismissViewControllerAnimated:NO completion:nil];
currentAlert = nil;
}
@@ -678,47 +678,46 @@
__weak typeof(self) weakSelf = self;
[currentAlert dismiss:NO];
[currentAlert dismissViewControllerAnimated:NO completion:nil];
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
currentAlert = [[MXKAlert alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedStringFromTable(@"google_analytics_use_prompt", @"Vector", nil), appDisplayName]
message:nil
style:MXKAlertStyleAlert];
currentAlert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:NSLocalizedStringFromTable(@"google_analytics_use_prompt", @"Vector", nil), appDisplayName] message:nil preferredStyle:UIAlertControllerStyleAlert];
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"no"]
style:MXKAlertActionStyleDefault
handler:^(MXKAlert *alert) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"enableCrashReport"];
[[NSUserDefaults standardUserDefaults] synchronize];
if (weakSelf)
{
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
}
}];
[currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"yes"]
style:MXKAlertActionStyleDefault
handler:^(MXKAlert *alert) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"enableCrashReport"];
[[NSUserDefaults standardUserDefaults] synchronize];
if (weakSelf)
{
__strong __typeof(weakSelf)strongSelf = weakSelf;
strongSelf->currentAlert = nil;
}
[[AppDelegate theDelegate] startGoogleAnalytics];
}];
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"no"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"enableCrashReport"];
[[NSUserDefaults standardUserDefaults] synchronize];
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
}
}]];
currentAlert.mxkAccessibilityIdentifier = @"HomeVCUseGoogleAnalyticsAlert";
[currentAlert showInViewController:self];
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"yes"]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"enableCrashReport"];
[[NSUserDefaults standardUserDefaults] synchronize];
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
}
[[AppDelegate theDelegate] startGoogleAnalytics];
}]];
[currentAlert mxk_setAccessibilityIdentifier: @"HomeVCUseGoogleAnalyticsAlert"];
[self presentViewController:currentAlert animated:YES completion:nil];
}
#pragma mark - UITabBarDelegate