Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 939 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 939 Bytes

VersionComparator Class

An app that I developed works by downloading resources from an internet location. The first step before I put my app through an intensive download process is to check that the resource has updated. I use version numbers on my resources and store a bunch of local version numbers related to the files previously downloaded.

Example

The main concept is splitting the version numbers and comparing each segment individually.

Obviously, when splitting parts, if the first number in a version is higher, then there's no need to compare further. If the first number matches, then do the same check on the second number.

BOOL greater = [VersionComparator isVersion:@"2.0.0" greaterThanVersion:@"1.1.0"];

Expansion

I would like any potential contributors to help expand this class to include additional functions with the followin

  1. Keep it Light
  2. Keep it User-Friendly