From eb9e9d60dabfc6f45baa0fb5fd7a7980151b93e8 Mon Sep 17 00:00:00 2001 From: Katsuyoshi Ito Date: Sat, 30 Jan 2016 10:59:54 +0900 Subject: [PATCH] add new method -showInView:releaseNotesText: . - setupViewWithAppIdentifier:releaseNotesTitle:closeButtonTitle:completionBlock: reported releaseNotesText. I want to modify releaseNotesText and show it. [TWSReleaseNotesView setupViewWithAppIdentifier:@"XXXXXXXXX" releaseNotesTitle:[NSString stringWithFormat:@"What's new in version %@:", currentAppVersion] closeButtonTitle:@"Close" completionBlock:^(TWSReleaseNotesView *releaseNotesView, NSString *releaseNotesText, NSError *error){ if (error) { // Handle errors NSLog(@"An error occurred: %@", [error localizedDescription]); } else { // Create and show release notes view NSString *modifiedReleaseNotesText = [NSString stringWithFormat:@"%@\n\nTo see any version information, please visit iTunes site", releaseNotesText]; [releaseNotesView showInView:self.view releaseNotesText:modifiedReleaseNotesText]; } }]; --- TWSReleaseNotesView/TWSReleaseNotesView.h | 7 +++++++ TWSReleaseNotesView/TWSReleaseNotesView.m | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.h b/TWSReleaseNotesView/TWSReleaseNotesView.h index 856aaa9..984f1f2 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.h +++ b/TWSReleaseNotesView/TWSReleaseNotesView.h @@ -132,4 +132,11 @@ */ - (void)showInView:(UIView *)containerView; +/** + Shows the release notes view in the specified container view. + @param containerView The container view in which the release notes view must be shown. + @param releaseNotesText The release notes text. + */ +- (void)showInView:(UIView *)containerView releaseNotesText:(NSString *)releaseNotesText; + @end diff --git a/TWSReleaseNotesView/TWSReleaseNotesView.m b/TWSReleaseNotesView/TWSReleaseNotesView.m index 1567145..0b7eebb 100644 --- a/TWSReleaseNotesView/TWSReleaseNotesView.m +++ b/TWSReleaseNotesView/TWSReleaseNotesView.m @@ -509,4 +509,11 @@ - (void)showInView:(UIView *)containerView }]; } +- (void)showInView:(UIView *)containerView releaseNotesText:(NSString *)releaseNotesText +{ + _releaseNotesText = [releaseNotesText copy]; + [_textView setText:_releaseNotesText]; + [self showInView:containerView]; +} + @end