Permalink
Browse files

Merge pull request #3 from esromneb/master

adding a function to hide all panels directly under a view
  • Loading branch information...
2 parents 1661c3b + c8ce66c commit 6c6e0d51bcacb94dbe609937ee684655773e3167 @MugunthKumar committed Jan 26, 2013
Showing with 16 additions and 0 deletions.
  1. +1 −0 MKInfoBundle/MKInfoPanel.h
  2. +15 −0 MKInfoBundle/MKInfoPanel.m
@@ -56,5 +56,6 @@ typedef enum {
+ (MKInfoPanel *)showPanelInWindow:(UIWindow*)window type:(MKInfoPanelType)type title:(NSString *)title subtitle:(NSString *)subtitle hideAfter:(NSTimeInterval)interval;
- (void)hidePanel;
++(BOOL)hideAllPanelsUnderView:(UIView*)view;
@end
View
@@ -164,6 +164,21 @@ -(void)hidePanel {
[self performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.25];
}
+// Hides all panels under a view, returns success
++(BOOL)hideAllPanelsUnderView:(UIView*)view
+{
+ BOOL flag = NO;
+ for (UIView *subView in view.subviews) {
+ if ([subView isKindOfClass:[MKInfoPanel class]]) {
+ MKInfoPanel* panel = (MKInfoPanel*)subView;
+ [panel hidePanel];
+ flag = YES;
+ }
+ }
+
+ return flag;
+}
+
////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark Touch Recognition

0 comments on commit 6c6e0d5

Please sign in to comment.