Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nullability Annotations to Previous Version / Build Methods #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions GBVersionTracking/GBVersionTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,61 +35,61 @@ typedef void(^GBVersionTrackingHandlerBlock)(void);
/**
Check if this is the first launch, for a particular version number. Useful if you want to execute some code for first time launches of a particular version (like db migrations?).
*/
+ (BOOL)isFirstLaunchForVersion:(NSString *)version;
+ (BOOL)isFirstLaunchForVersion:(nonnull NSString *)version;

/**
Check if this is the first launch, for a particular build number. Useful if you want to execute some code for first time launches of a particular version (like db migrations?).
*/
+ (BOOL)isFirstLaunchForBuild:(NSString *)build;
+ (BOOL)isFirstLaunchForBuild:(nonnull NSString *)build;

/**
Calls block if the condition is satisfied that the current version matches `version`, and this is the first time this app version is being launched.
*/
+ (void)callBlockOnFirstLaunchOfVersion:(NSString *)version block:(GBVersionTrackingHandlerBlock)block;
+ (void)callBlockOnFirstLaunchOfVersion:(nonnull NSString *)version block:(nonnull GBVersionTrackingHandlerBlock)block;

/**
Calls block if the condition is satisfied that the current build matches `build`, and this is the first time this app build is being launched.
*/
+ (void)callBlockOnFirstLaunchOfBuild:(NSString *)build block:(GBVersionTrackingHandlerBlock)block;
+ (void)callBlockOnFirstLaunchOfBuild:(nonnull NSString *)build block:(nonnull GBVersionTrackingHandlerBlock)block;

/**
Returns the current version of the app, as defined in the PList, e.g. "4.3".
*/
+ (NSString *)currentVersion;
+ (nonnull NSString *)currentVersion;

/**
Returns the previous version of the app, as defined in the PList, e.g. "4.3".
*/
+ (NSString *)previousVersion;
+ (nullable NSString *)previousVersion;

/**
Returns the version which the user first installed the app at.
*/
+ (NSString *)firstInstalledVersion;
+ (nullable NSString *)firstInstalledVersion;

/**
Returns a sorted array of versions which the user has had installed, e.g. ["3.5", "4.0", "4.1"]. In terms of ordering, more recent versions are appended at the back of the array. The array includes the current version as the last element.
*/
+ (NSArray *)versionHistory;
+ (nullable NSArray *)versionHistory;

/**
Returns the current build of the app, as defined in the PList, e.g. "4300".
*/
+ (NSString *)currentBuild;
+ (nonnull NSString *)currentBuild;

/**
Returns the previous build of the app, as defined in the PList, e.g. "4300".
*/
+ (NSString *)previousBuild;
+ (nullable NSString *)previousBuild;

/**
Returns the version which the user first installed the app at.
*/
+ (NSString *)firstInstalledBuild;
+ (nullable NSString *)firstInstalledBuild;

/**
Returns a sorted array of builds which the user has had installed, e.g. ["3500", "4000", "4100"]. In terms of ordering, more recent builds are appended at the back of the array. The array includes the current build as the last element.
*/
+ (NSArray *)buildHistory;
+ (nullable NSArray *)buildHistory;

@end