Quantcast
Viewing all articles
Browse latest Browse all 37

Answer by Sargis for Objective-C - UIAlertView doesn't delegate

Use this code. (UIAlertView is deprecated since iOS 9.0.)

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Idioma" message:@"" preferredStyle:UIAlertControllerStyleAlert];    [alert addAction:[UIAlertAction actionWithTitle:@"English" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {        [[LanguagesManager sharedInstance] setLanguage:@"en"];    }]];    [alert addAction:[UIAlertAction actionWithTitle:@"Español" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {        [[LanguagesManager sharedInstance] setLanguage:@"es"];    }]];    [alert addAction:[UIAlertAction actionWithTitle:@"Deustch" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {        [[LanguagesManager sharedInstance] setLanguage:@"de"];    }]];    [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {        [[LanguagesManager sharedInstance] setLanguage:@"es"];    }]];    [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil];

Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>