Skip to content

Commit cd34d94

Browse files
committed
Resolves #1, fixing snackbars for use with modally presented view controllers
1 parent 20f72b8 commit cd34d94

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Pod/Classes/SSSnackbar.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ - (void)drawRect:(CGRect)rect {
101101
}
102102

103103
- (void)show {
104+
UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController;
105+
while (topController.presentedViewController) {
106+
topController = topController.presentedViewController;
107+
}
108+
109+
UIView *superview = topController.view;
104110

105-
UIView *superview = [UIApplication sharedApplication].delegate.window.rootViewController.view;
106111
BOOL shouldReplaceExistingSnackbar = currentlyVisibleSnackbar != nil;
107112

108113
if (shouldReplaceExistingSnackbar) {

0 commit comments

Comments
 (0)