diff --git a/PopoverView/PopoverView.h b/PopoverView/PopoverView.h index 5ff782b..55eab73 100644 --- a/PopoverView/PopoverView.h +++ b/PopoverView/PopoverView.h @@ -69,9 +69,12 @@ //Delegate receives this call as soon as the item has been selected - (void)popoverView:(PopoverView *)popoverView didSelectItemAtIndex:(NSInteger)index; -//Delegate receives this call once the popover has begun the dismissal animation +//Delegate receives this call once the popover has finished the dismissal animation - (void)popoverViewDidDismiss:(PopoverView *)popoverView; +//Delegate receives this call once the popover has begun the dismissal animation +- (void)popoverViewWillDismiss:(PopoverView *)popoverView; + @end @interface PopoverView : UIView { diff --git a/PopoverView/PopoverView.m b/PopoverView/PopoverView.m index 1bf43b5..a5dd650 100644 --- a/PopoverView/PopoverView.m +++ b/PopoverView/PopoverView.m @@ -815,6 +815,10 @@ - (void)dismiss - (void)dismiss:(BOOL)animated { + if (self.delegate && [self.delegate respondsToSelector:@selector(popoverViewWillDismiss:)]) { + [delegate popoverViewWillDismiss:self]; + } + if (!animated) { [self dismissComplete];