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
-
overlayAlpha
The alpha value for the overlay to be applied to the container view. Default is
property0.5f
. -
textViewAlpha
The alpha value for the background color to be applied to the text container view. Default is
property0.8f
. -
textViewBackgroundColor
The background color to be applied to the text container view. Default is
property[UIColor blackColor]
. -
darkSeparatorColor
The 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]
. -
lightSeparatorColor
The 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]
. -
viewShadowColor
The shadow color for the release notes view. Default is
property[UIColor blackColor]
. -
viewShadowOffset
The shadow offset for the release notes view. Default is
property(0.0f, 3.0f)
. -
viewShadowRadius
The shadow radius for the release notes view. Default is
property3.0f
. -
viewShadowOpacity
The shadow opacity for the release notes view. Default is
property1.0f
. -
titleFont
The font for the title label. Default is
property[UIFont systemFontOfSize:16.0f]
. -
titleColor
The color for the title label. Default is
property[UIColor whiteColor]
. -
titleShadowColor
The shadow color for the title label. Default is
property[UIColor blackColor]
. -
titleShadowOffset
The shadow offset for the title label. Default is
property(0.0f, -1.0f)
. -
releaseNotesFont
The font for the release notes text view. Default is
property[UIFont systemFontOfSize:14.0f]
. -
releaseNotesColor
The color for the release notes text view. Default is
property[UIColor whiteColor]
. -
releaseNotesShadowColor
The shadow color for the release notes text view. Default is
property[UIColor blackColor]
. -
releaseNotesShadowOffset
The shadow offset for the release notes text view. Default is
property(0.0f, -1.0f)
. -
closeButtonFont
The font for the close button. Default is
property[UIFont systemFontOfSize:16.0f]
. -
closeButtonColor
The color for the close button. Default is
property[UIColor whiteColor]
. -
closeButtonShadowColor
The shadow color for the close button. Default is
property[UIColor blackColor]
. -
closeButtonShadowOffset
The 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
-
+ isAppVersionUpdated
Checks for app update state, using the
CFBundleVersion
key in the applicationInfo.plist
. -
+ isAppOnFirstLaunch
Checks 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 *closeButtonColor
Declared In
TWSReleaseNotesView.h
closeButtonFont
The font for the close button. Default is [UIFont systemFontOfSize:16.0f]
.
@property (strong, nonatomic) UIFont *closeButtonFont
Declared In
TWSReleaseNotesView.h
closeButtonShadowColor
The shadow color for the close button. Default is [UIColor blackColor]
.
@property (strong, nonatomic) UIColor *closeButtonShadowColor
Declared In
TWSReleaseNotesView.h
closeButtonShadowOffset
The shadow offset for the close button. Default is (0.0f, -1.0f)
.
@property (assign, nonatomic) CGSize closeButtonShadowOffset
Declared In
TWSReleaseNotesView.h
darkSeparatorColor
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 *darkSeparatorColor
Declared In
TWSReleaseNotesView.h
lightSeparatorColor
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 *lightSeparatorColor
Declared In
TWSReleaseNotesView.h
overlayAlpha
The alpha value for the overlay to be applied to the container view. Default is 0.5f
.
@property (assign, nonatomic) CGFloat overlayAlpha
Declared In
TWSReleaseNotesView.h
releaseNotesColor
The color for the release notes text view. Default is [UIColor whiteColor]
.
@property (strong, nonatomic) UIColor *releaseNotesColor
Declared In
TWSReleaseNotesView.h
releaseNotesFont
The font for the release notes text view. Default is [UIFont systemFontOfSize:14.0f]
.
@property (strong, nonatomic) UIFont *releaseNotesFont
Declared In
TWSReleaseNotesView.h
releaseNotesShadowColor
The shadow color for the release notes text view. Default is [UIColor blackColor]
.
@property (strong, nonatomic) UIColor *releaseNotesShadowColor
Declared In
TWSReleaseNotesView.h
releaseNotesShadowOffset
The shadow offset for the release notes text view. Default is (0.0f, -1.0f)
.
@property (assign, nonatomic) CGSize releaseNotesShadowOffset
Declared In
TWSReleaseNotesView.h
textViewAlpha
The alpha value for the background color to be applied to the text container view. Default is 0.8f
.
@property (assign, nonatomic) CGFloat textViewAlpha
Declared In
TWSReleaseNotesView.h
textViewBackgroundColor
The background color to be applied to the text container view. Default is [UIColor blackColor]
.
@property (strong, nonatomic) UIColor *textViewBackgroundColor
Declared In
TWSReleaseNotesView.h
titleColor
The color for the title label. Default is [UIColor whiteColor]
.
@property (strong, nonatomic) UIColor *titleColor
Declared In
TWSReleaseNotesView.h
titleFont
The font for the title label. Default is [UIFont systemFontOfSize:16.0f]
.
@property (strong, nonatomic) UIFont *titleFont
Declared In
TWSReleaseNotesView.h
titleShadowColor
The shadow color for the title label. Default is [UIColor blackColor]
.
@property (strong, nonatomic) UIColor *titleShadowColor
Declared In
TWSReleaseNotesView.h
titleShadowOffset
The shadow offset for the title label. Default is (0.0f, -1.0f)
.
@property (assign, nonatomic) CGSize titleShadowOffset
Declared In
TWSReleaseNotesView.h
viewShadowColor
The shadow color for the release notes view. Default is [UIColor blackColor]
.
@property (strong, nonatomic) UIColor *viewShadowColor
Declared In
TWSReleaseNotesView.h
viewShadowOffset
The shadow offset for the release notes view. Default is (0.0f, 3.0f)
.
@property (assign, nonatomic) CGSize viewShadowOffset
Declared In
TWSReleaseNotesView.h
Class Methods
isAppOnFirstLaunch
Checks if the app version key is currently stored or not.
+ (BOOL)isAppOnFirstLaunch
Return Value
Returns YES
if no previous app version string was stored, NO
otherwise.
Declared In
TWSReleaseNotesView.h
isAppVersionUpdated
Checks for app update state, using the CFBundleVersion
key in the application Info.plist
.
+ (BOOL)isAppVersionUpdated
Return 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.h
setupViewWithAppIdentifier: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 ))completionBlock
Parameters
- 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
NSError
object is passed to the block otherwise.
Declared In
TWSReleaseNotesView.h
viewWithReleaseNotesTitle:text:closeButtonTitle:
Returns a release notes view initialized with custom parameters.
+ (TWSReleaseNotesView *)viewWithReleaseNotesTitle:(NSString *)releaseNotesTitle text:(NSString *)releaseNotesText closeButtonTitle:(NSString *)closeButtonTitle
Parameters
- 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