Skip to content

Commit

Permalink
Merged pull request #1 from nonamelive/master.
Browse files Browse the repository at this point in the history
Added showPanelInWindow method.
  • Loading branch information
MugunthKumar committed Apr 27, 2011
2 parents b18797d + 91f9395 commit 1d66e5e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MKInfoBundle/MKInfoPanel.h
Expand Up @@ -42,4 +42,6 @@ typedef enum MKInfoPanelType_

+(void) showPanelInView:(UIView*) view type:(MKInfoPanelType) type title:(NSString*) title subtitle:(NSString*) subtitle hideAfter:(NSTimeInterval) interval;

+(void) showPanelInWindow:(UIWindow*) window type:(MKInfoPanelType) type title:(NSString*) title subtitle:(NSString*) subtitle hideAfter:(NSTimeInterval) interval;

@end
22 changes: 22 additions & 0 deletions MKInfoBundle/MKInfoPanel.m
Expand Up @@ -103,6 +103,28 @@ +(void) showPanelInView:(UIView*) view type:(MKInfoPanelType) type title:(NSStri
[panel performSelector:@selector(hidePanel) withObject:view afterDelay:interval];
}

+(void) showPanelInWindow:(UIWindow*) window type:(MKInfoPanelType) type title:(NSString*) title subtitle:(NSString*) subtitle hideAfter:(NSTimeInterval) interval
{
MKInfoPanel *panel = [MKInfoPanel infoPanel];
[panel setType:type];
panel.titleLabel.text = title;
if(subtitle)
{
panel.detailLabel.text = subtitle;
}
else
{
panel.detailLabel.hidden = YES;
panel.frame = CGRectMake(0, 20, 320, 50);
panel.thumbImage.frame = CGRectMake(15, 5, 35, 35);
panel.titleLabel.frame = CGRectMake(57, 12, 240, 21);

}

[window addSubview:panel];
[panel performSelector:@selector(hidePanel) withObject:window afterDelay:interval];
}

-(void) hidePanel
{
CATransition *transition = [CATransition animation];
Expand Down

0 comments on commit 1d66e5e

Please sign in to comment.