Closed ignasibm closed 8 years ago
Hi @ignasibm, this can be done in many ways
Getting the window RootViewController
SCLAlertView *alert = [[SCLAlertView alloc] init];
UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
[alert showCustom:rootViewController title:@"Hello World" subTitle:@"This is a more descriptive text." closeButtonTitle:@"Done" duration:0.0f];
or using the navigationController
SCLAlertView *alert = [[SCLAlertView alloc] init];
[alert showCustom:self.navigationController title:@"Hello World" subTitle:@"This is a more descriptive text." closeButtonTitle:@"Done" duration:0.0f];
or creating a new window
SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindow];
[alert showSuccess:@"Hello World" subTitle:@"This is a more descriptive text." closeButtonTitle:@"Done" duration:0.0f];
HI @dogo thank you for your help, it worked!
Some feedback in my particular case. Using the NavController method, the TabBar was still showing over the Alert. It was using the RootViewController method that worked like a charm.
Thanks again :)
Great :D
great job, thanks you
Hello, first of all thanks for your work, SCLAlerts looks awesome! I just wanted to know if there's a way to make the Alert take the "whole screen space" like UIAlertController (or UIAlertView did). As you are going to see in the following screenshot, the Alert itself seems to be centered just ok, in the middle of the screen, but the "shadow view" that appears at the same time than the alert only goes from my navigation bar to my tabbar. Also, navigation bar and tabbar are still functionall when the a SCLAlertView is showing. This is confusing because this didn't happen with UIAlerController o UIAlertView. Any ideas?
Thanks :)
Include the following:
1.0.4
9.3
iPhone 6
Reproduction Steps
This is the code I used to create the SCLAlertView:
`SCLAlertView *alert = [[SCLAlertView alloc] init]; alert.shouldDismissOnTapOutside = YES; [alert removeTopCircle];
`
Expected Result
Shadowview should cover the whole screen
Actual Result
It doesn't >.<