diff --git a/CMPopTipView/CMPopTipView.h b/CMPopTipView/CMPopTipView.h index 1e413bd..5c3e855 100644 --- a/CMPopTipView/CMPopTipView.h +++ b/CMPopTipView/CMPopTipView.h @@ -133,6 +133,7 @@ typedef NS_ENUM(NSInteger, CMPopTipAnimation) { @property (nonatomic, assign) CGFloat pointerSize; @property (nonatomic, assign) CGFloat bubblePaddingX; @property (nonatomic, assign) CGFloat bubblePaddingY; +@property (nonatomic, assign) NSTimeInterval hideAfter; /* Contents can be either a message or a UIView */ - (id)initWithTitle:(NSString *)titleToShow message:(NSString *)messageToShow; diff --git a/CMPopTipView/CMPopTipView.m b/CMPopTipView/CMPopTipView.m index 83f2dfb..93330f4 100644 --- a/CMPopTipView/CMPopTipView.m +++ b/CMPopTipView/CMPopTipView.m @@ -346,6 +346,10 @@ - (void)drawRect:(__unused CGRect)rect #pragma clang diagnostic pop } + + if (self.hideAfter) { + [self performSelector:@selector(dismissByUser) withObject:nil afterDelay:self.hideAfter]; + } } }