Skip to content
Open
Show file tree
Hide file tree
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
29 changes: 16 additions & 13 deletions EDSemver/EDSemver.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,39 @@

#import <Foundation/Foundation.h>

/**
`EDSemver` is a helper library for Objective-C based on the 2.0.0 spec of [Semantic Versioning](https://semver.org/).
*/
@interface EDSemver : NSObject

/*!
/**
* The major version number (API changes)
*/
@property (readonly) NSInteger major;
/*!
/**
* The minor version (functionality added in a backwards compatible manor)
*/
@property (readonly) NSInteger minor;
/*!
/**
* The patch version (bug fixes made in a backwards compatible manor)
*/
@property (readonly) NSInteger patch;
/*!
/**
* The prerelease number, preceded with -, e.g. 1.2.3-alpha1
*/
@property (readonly, nullable) NSString *prerelease;
/*!
/**
* The build number, preceded with +, e.g. 1.2.3+456
*/
@property (readonly, nullable) NSString *build;

/*!
/**
* The current semver spec version
*
* @return The spec version as a string
*/
+ (nonnull NSString *)spec;
/*!
/**
* Create a semver object with a version string
*
* @param aString The version string
Expand All @@ -46,7 +49,7 @@
*/
+ (nonnull instancetype)semverWithString:(nonnull NSString *)aString;

/*!
/**
* Create a semver object with a version string
*
* @param aString The version string
Expand All @@ -55,15 +58,15 @@
*/
- (nonnull instancetype)initWithString:(nonnull NSString *)aString;

/*!
/**
* Compare semver objects
*
* @param aVersion The version string
*
* @return The semver object
*/
- (NSComparisonResult)compare:(nonnull EDSemver *)aVersion;
/*!
/**
* Is version equal to another version
* Implemented using `compare:`. Returns NO parameter is nil
*
Expand All @@ -72,7 +75,7 @@
* @return YES if equal, NO otherwise
*/
- (BOOL)isEqualTo:(nullable id)object;
/*!
/**
* Is version less than another version.
* Implemented using `compare:`. Returns NO parameter is nil
*
Expand All @@ -81,7 +84,7 @@
* @return YES if less than, NO otherwise
*/
- (BOOL)isLessThan:(nullable id)object;
/*!
/**
* Is version greater than than another version.
* Implemented using `compare:`. Returns NO parameter is nil
*
Expand All @@ -91,7 +94,7 @@
*/
- (BOOL)isGreaterThan:(nullable id)object;

/*!
/**
* Is the semver object valid?
*
* @return YES if valid, NO otherwise
Expand Down
14 changes: 13 additions & 1 deletion Project/semver.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
attributes = {
CLASSPREFIX = ED;
LastTestingUpgradeCheck = 0730;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = "Andrew Sliwinski";
TargetAttributes = {
01DA90111D0ADA5F00D65599 = {
Expand Down Expand Up @@ -802,11 +802,17 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -843,11 +849,17 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down