Skip to content

Commit

Permalink
Merge pull request #4 from restorando/bug/support-tabbar
Browse files Browse the repository at this point in the history
Amazing and creative way to fix an issue in a beautiful library :)
  • Loading branch information
GabrielDarioRos committed Mar 20, 2015
2 parents 56c6be8 + fbcfcc6 commit 4c7e1e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Classes/ios/MMPopLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ - (void)layoutSubviews
[self setupAppearance];
}

//HORRIBLE HORRIBLE HACK !!!
- (CGFloat)tabBarHeight
{
UITabBar *tabBar;
UIViewController *rootVC = [[[UIApplication sharedApplication] keyWindow] rootViewController];
if ([rootVC isKindOfClass:[UITabBarController class]]) {
tabBar = [((UITabBarController *) rootVC) tabBar];
}
return tabBar != nil ? tabBar.frame.size.height : 0;
}

- (void)popAtView:(UIView *)view {
[self popAtView:view animated:YES];
}
Expand All @@ -231,7 +242,7 @@ - (void)popAtView:(UIView *)view animated: (BOOL) animated
if (self.frame.origin.y + self.frame.size.height > [UIScreen mainScreen].applicationFrame.size.height) {
_arrowType = MMPopLabelBottomArrow;
position = CGPointMake(position.x,
[UIScreen mainScreen].applicationFrame.size.height - (self.frame.size.height + view.frame.size.height + kMMPopLabelViewPadding));
[UIScreen mainScreen].applicationFrame.size.height - (self.frame.size.height + view.frame.size.height + kMMPopLabelViewPadding + /*HORRIBLE HACK !!!*/[self tabBarHeight]));
}

CGPoint centerPoint = CGPointMake(position.x, position.y + self.frame.size.height / 2);
Expand Down
2 changes: 1 addition & 1 deletion MMPopLabel.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MMPopLabel"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "MMPopLabel is a tooltip control for iOS, with optional buttons"
s.description = <<-DESC
MMPopLabel is a tooltip control for iOS, useful for tutorials.
Expand Down

0 comments on commit 4c7e1e2

Please sign in to comment.