A better way to compare the version level.
Here's a simple example for comparing two versions.
/* Tips: Press the key [option + 6] to type §. */
let v1 = §"2.3.4"
let v2: Version = "10.2.4"
if v2 > v1 {
// Do something in a high version
} else {
// Do other things
}
Enjoy it!
- Swift 5
- Xcode 9+
- iOS 8+
pod 'OhMyVersion'
All source code is licensed under the MIT License.