TWSReleaseNotesView Class Reference
| Inherits from | UIView |
| Declared in | TWSReleaseNotesView.h TWSReleaseNotesView.m |
Overview
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.
If you want to check if the app is on its first launch, you can use the isAppOnFirstLaunch method. This method will check a previously stored app version string. If a stored app version string does not exist, it will return YES, storing the current version string.
In order to check if the app was updated, the isAppVersionUpdated method can be used. This method will check a previously stored app version string. If a stored app version string is present but it does not match the current version string, it will return YES, storing the current version string.
The release notes view can be initialized using the viewWithReleaseNotesTitle:text:closeButtonTitle: class method, if the release notes text is set directly when calling the method. If the release notes must be retrieved from the App Store, you must use the setupViewWithAppIdentifier:releaseNotesTitle:closeButtonTitle:completionBlock: class method.
The appearance of the view can be customized using its alpha, color and font properties, to be set before showing the release notes view with the showInView: instance method.
Tasks
Setting main properties
-
overlayAlphaThe alpha value for the overlay to be applied to the container view. Default is
property0.5f. -
textViewAlphaThe alpha value for the background color to be applied to the text container view. Default is
property0.8f. -
textViewBackgroundColorThe background color to be applied to the text container view. Default is
property[UIColor blackColor]. -
darkSeparatorColorThe dark separator color. Default is
property[UIColor colorWithRed:16.0f/255.0f green:16.0f/255.0f blue:16.0f/255.0f alpha:1.0]. -
lightSeparatorColorThe light separator color. Default is
property[UIColor colorWithRed:58.0f/255.0f green:58.0f/255.0f blue:65.0f/255.0f alpha:1.0]. -
viewShadowColorThe shadow color for the release notes view. Default is
property[UIColor blackColor]. -
viewShadowOffsetThe shadow offset for the release notes view. Default is
property(0.0f, 3.0f). -
viewShadowRadiusThe shadow radius for the release notes view. Default is
property3.0f. -
viewShadowOpacityThe shadow opacity for the release notes view. Default is
property1.0f. -
titleFontThe font for the title label. Default is
property[UIFont systemFontOfSize:16.0f]. -
titleColorThe color for the title label. Default is
property[UIColor whiteColor]. -
titleShadowColorThe shadow color for the title label. Default is
property[UIColor blackColor]. -
titleShadowOffsetThe shadow offset for the title label. Default is
property(0.0f, -1.0f). -
releaseNotesFontThe font for the release notes text view. Default is
property[UIFont systemFontOfSize:14.0f]. -
releaseNotesColorThe color for the release notes text view. Default is
property[UIColor whiteColor]. -
releaseNotesShadowColorThe shadow color for the release notes text view. Default is
property[UIColor blackColor]. -
releaseNotesShadowOffsetThe shadow offset for the release notes text view. Default is
property(0.0f, -1.0f). -
closeButtonFontThe font for the close button. Default is
property[UIFont systemFontOfSize:16.0f]. -
closeButtonColorThe color for the close button. Default is
property[UIColor whiteColor]. -
closeButtonShadowColorThe shadow color for the close button. Default is
property[UIColor blackColor]. -
closeButtonShadowOffsetThe shadow offset for the close button. Default is
property(0.0f, -1.0f).
Creating the release notes view
-
+ viewWithReleaseNotesTitle:text:closeButtonTitle:Returns a release notes view initialized with custom parameters.
-
+ setupViewWithAppIdentifier:releaseNotesTitle:closeButtonTitle:completionBlock:Creates a release notes view initialized with custom parameters and returns it in the completion block.
Checking the app version
-
+ isAppVersionUpdatedChecks for app update state, using the
CFBundleVersionkey in the applicationInfo.plist. -
+ isAppOnFirstLaunchChecks if the app version key is currently stored or not.
Showing the release notes view
-
– showInView:Shows the release notes view in the specified container view.
Properties
closeButtonColor
The color for the close button. Default is [UIColor whiteColor].
@property (strong, nonatomic) UIColor *closeButtonColorDeclared In
TWSReleaseNotesView.hcloseButtonFont
The font for the close button. Default is [UIFont systemFontOfSize:16.0f].
@property (strong, nonatomic) UIFont *closeButtonFontDeclared In
TWSReleaseNotesView.hcloseButtonShadowColor
The shadow color for the close button. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *closeButtonShadowColorDeclared In
TWSReleaseNotesView.hcloseButtonShadowOffset
The shadow offset for the close button. Default is (0.0f, -1.0f).
@property (assign, nonatomic) CGSize closeButtonShadowOffsetDeclared In
TWSReleaseNotesView.hdarkSeparatorColor
The dark separator color. Default is [UIColor colorWithRed:16.0f/255.0f green:16.0f/255.0f blue:16.0f/255.0f alpha:1.0].
@property (strong, nonatomic) UIColor *darkSeparatorColorDeclared In
TWSReleaseNotesView.hlightSeparatorColor
The light separator color. Default is [UIColor colorWithRed:58.0f/255.0f green:58.0f/255.0f blue:65.0f/255.0f alpha:1.0].
@property (strong, nonatomic) UIColor *lightSeparatorColorDeclared In
TWSReleaseNotesView.hoverlayAlpha
The alpha value for the overlay to be applied to the container view. Default is 0.5f.
@property (assign, nonatomic) CGFloat overlayAlphaDeclared In
TWSReleaseNotesView.hreleaseNotesColor
The color for the release notes text view. Default is [UIColor whiteColor].
@property (strong, nonatomic) UIColor *releaseNotesColorDeclared In
TWSReleaseNotesView.hreleaseNotesFont
The font for the release notes text view. Default is [UIFont systemFontOfSize:14.0f].
@property (strong, nonatomic) UIFont *releaseNotesFontDeclared In
TWSReleaseNotesView.hreleaseNotesShadowColor
The shadow color for the release notes text view. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *releaseNotesShadowColorDeclared In
TWSReleaseNotesView.hreleaseNotesShadowOffset
The shadow offset for the release notes text view. Default is (0.0f, -1.0f).
@property (assign, nonatomic) CGSize releaseNotesShadowOffsetDeclared In
TWSReleaseNotesView.htextViewAlpha
The alpha value for the background color to be applied to the text container view. Default is 0.8f.
@property (assign, nonatomic) CGFloat textViewAlphaDeclared In
TWSReleaseNotesView.htextViewBackgroundColor
The background color to be applied to the text container view. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *textViewBackgroundColorDeclared In
TWSReleaseNotesView.htitleColor
The color for the title label. Default is [UIColor whiteColor].
@property (strong, nonatomic) UIColor *titleColorDeclared In
TWSReleaseNotesView.htitleFont
The font for the title label. Default is [UIFont systemFontOfSize:16.0f].
@property (strong, nonatomic) UIFont *titleFontDeclared In
TWSReleaseNotesView.htitleShadowColor
The shadow color for the title label. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *titleShadowColorDeclared In
TWSReleaseNotesView.htitleShadowOffset
The shadow offset for the title label. Default is (0.0f, -1.0f).
@property (assign, nonatomic) CGSize titleShadowOffsetDeclared In
TWSReleaseNotesView.hviewShadowColor
The shadow color for the release notes view. Default is [UIColor blackColor].
@property (strong, nonatomic) UIColor *viewShadowColorDeclared In
TWSReleaseNotesView.hviewShadowOffset
The shadow offset for the release notes view. Default is (0.0f, 3.0f).
@property (assign, nonatomic) CGSize viewShadowOffsetDeclared In
TWSReleaseNotesView.hClass Methods
isAppOnFirstLaunch
Checks if the app version key is currently stored or not.
+ (BOOL)isAppOnFirstLaunchReturn Value
Returns YES if no previous app version string was stored, NO otherwise.
Declared In
TWSReleaseNotesView.hisAppVersionUpdated
Checks for app update state, using the CFBundleVersion key in the application Info.plist.
+ (BOOL)isAppVersionUpdatedReturn Value
Returns YES if a previous app version string was stored and if it does not match the current version string, NO otherwise.
Declared In
TWSReleaseNotesView.hsetupViewWithAppIdentifier:releaseNotesTitle:closeButtonTitle:completionBlock:
Creates a release notes view initialized with custom parameters and returns it in the completion block.
+ (void)setupViewWithAppIdentifier:(NSString *)appIdentifier releaseNotesTitle:(NSString *)releaseNotesTitle closeButtonTitle:(NSString *)closeButtonTitle completionBlock:(void ( ^ ) ( TWSReleaseNotesView *releaseView , NSString *releaseNoteText , NSError *error ))completionBlockParameters
- appIdentifier
The App Store app identifier for remote release notes retrieval.
- releaseNotesTitle
The title for the release notes view.
- closeButtonTitle
The title for the close button.
- completionBlock
The block to be used as a completion handler. If the release notes retrieval is successful, a reference to the initialized release notes view is passed to the block. A
NSErrorobject is passed to the block otherwise.
Declared In
TWSReleaseNotesView.hviewWithReleaseNotesTitle:text:closeButtonTitle:
Returns a release notes view initialized with custom parameters.
+ (TWSReleaseNotesView *)viewWithReleaseNotesTitle:(NSString *)releaseNotesTitle text:(NSString *)releaseNotesText closeButtonTitle:(NSString *)closeButtonTitleParameters
- releaseNotesTitle
The title for the release notes view.
- releaseNotesText
The release notes text.
- closeButtonTitle
The title for the close button.
Return Value
The initialized release notes view.
Declared In
TWSReleaseNotesView.h