diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.h b/TWSReleaseNotesView/TWSReleaseNotesView.h index 856aaa9..84a15a0 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.h +++ b/TWSReleaseNotesView/TWSReleaseNotesView.h @@ -8,6 +8,8 @@ #import +typedef void (^TWSReleaseNotesViewCompletionHandler)(void); + /** Use the `TWSReleaseNotesView` class to display a custom release notes view, to be shown when the app is opened for the first time after an update. @@ -87,6 +89,8 @@ /// The shadow offset for the close button. Default is `(0.0f, -1.0f)`. @property (assign, nonatomic) CGSize closeButtonShadowOffset; +/// A completion handler +@property (copy, nonatomic) TWSReleaseNotesViewCompletionHandler handler; /** @name Creating the release notes view */ diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.m b/TWSReleaseNotesView/TWSReleaseNotesView.m index 1567145..831d837 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.m +++ b/TWSReleaseNotesView/TWSReleaseNotesView.m @@ -377,6 +377,7 @@ - (void)prepareToShowInView:(UIView *)containerView [self.textView setFont:self.releaseNotesFont]; [self.textView setTextColor:self.releaseNotesColor]; + [self.textView setContentOffset:CGPointMake(0, 0) animated:NO]; [self.textView.layer setShadowColor:[self.releaseNotesShadowColor CGColor]]; [self.textView.layer setShadowOffset:self.releaseNotesShadowOffset]; @@ -466,6 +467,8 @@ - (void)dismiss if (finished) { [self removeFromSuperview]; + if (self.handler) + self.handler(); } }]; }