Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crash when used on iOS6 #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions LMAlertView/LMAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ - (void)setButtonsShouldStack:(BOOL)buttonsShouldStack
- (void)setTintColor:(UIColor *)tintColor
{
_tintColor = tintColor;
self.window.tintColor = tintColor;
if ([self.window respondsToSelector:@selector(setTintColor:)]) {
self.window.tintColor = self.tintColor;
}
}

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
Expand Down Expand Up @@ -430,7 +432,9 @@ - (void)show

// You can have more than one UIWindow in the view hierachy, which is how UIAlertView works
self.window = [[UIWindow alloc] initWithFrame:[appDelegate window].frame];
self.window.tintColor = self.tintColor;
if ([self.window respondsToSelector:@selector(setTintColor:)]) {
self.window.tintColor = self.tintColor;
}

LMEmbeddedViewController *viewController = [[LMEmbeddedViewController alloc] init];
viewController.alertView = self;
Expand Down