From 9dc0a4629de7221bcbc9067a512d45b6c251fc42 Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Tue, 29 Oct 2013 12:51:14 -0700 Subject: [PATCH 1/3] Ensure that release notes text is scrolled to the top --- TWSReleaseNotesView/TWSReleaseNotesView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.m b/TWSReleaseNotesView/TWSReleaseNotesView.m index 1567145..4983514 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]; From cd0e8916f15965dfa71975ca2176066e1cf4940b Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Wed, 20 May 2015 00:37:29 -0700 Subject: [PATCH 2/3] Add a completion handler --- TWSReleaseNotesView/TWSReleaseNotesView.h | 4 ++++ TWSReleaseNotesView/TWSReleaseNotesView.m | 2 ++ 2 files changed, 6 insertions(+) diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.h b/TWSReleaseNotesView/TWSReleaseNotesView.h index 856aaa9..883e276 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.h +++ b/TWSReleaseNotesView/TWSReleaseNotesView.h @@ -8,6 +8,8 @@ #import +typedef void (^TWSReleaseNotesViewCompletionHandler); + /** 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 4983514..831d837 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.m +++ b/TWSReleaseNotesView/TWSReleaseNotesView.m @@ -467,6 +467,8 @@ - (void)dismiss if (finished) { [self removeFromSuperview]; + if (self.handler) + self.handler(); } }]; } From ec7025439a450908750e3616fe0a8f44abcea7e2 Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Wed, 20 May 2015 00:46:30 -0700 Subject: [PATCH 3/3] Fix typedef --- TWSReleaseNotesView/TWSReleaseNotesView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.h b/TWSReleaseNotesView/TWSReleaseNotesView.h index 883e276..84a15a0 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.h +++ b/TWSReleaseNotesView/TWSReleaseNotesView.h @@ -8,7 +8,7 @@ #import -typedef void (^TWSReleaseNotesViewCompletionHandler); +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.