Helping you find inner peace when comparing version numbers in Swift

Overview

Versions logo

Helping you find inner peace when comparing version numbers in Swift.

Comparing with the current applications version couldn't be easier.

// App.version is 1.0.0
if App.version.olderThan("2.0.0") {
  // Prompt user to update
}

But you can apply this to more things than just the CFBundleShortVersionString.

let currentVersion = "1.0.1a"
if currentVersion.olderThan("1.1.3") {
    // update
}

Versions also support semantic versioning (Major, Minor, Patch)

if "1.0".semanticCompare("2.0") == Semantic.Major) {
    // major update
}

CocoaPod

Version License Platform

Verisons is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Versions"

Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create pull request

Who made this?

Comments
  • Semantic Versioning

    Semantic Versioning

    Agree on Semantic Versioning. Is this based on that site http://semver.org/

    Would it support A pre-release version additions Examples: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0 Also patch should be always Int type. I've misunderstood that

    opened by kostiakoval 9
  • Feature/super power

    Feature/super power

    I think it would be cool to have a static typed struct that represent version. Use example

    let v = Version("1.2.3")
    let new = Version("1.2.4")
    if new == v {
      // handle it
    }
    

    This is just a beginning ... We can add Comparable protocol to compare version

    let v = Version("1.0.1")
    let newV = Version("1.2.1")
    v > newV
    v == newV
    

    and more :) What do you thing @zenangst ?

    opened by kostiakoval 9
  • Swift space style

    Swift space style

    I love to use 2 space style. First I've tried it with ReactiveCocoa, it looks a bit better when you have nested code blocks with 2 space distance.

    In swift names and methods are shorter and nicer, and I like more to have 2 space distance. Based on this https://github.com/raywenderlich/swift-style-guide

    opened by kostiakoval 4
  • Update podspec version

    Update podspec version

    I was trying to use this framework as part of my project with Xcode 7.2. But the 0.3.0 version (CocoaPod) was pointed to an older commit that was not compatible with the latest Swift.

    Since pull request doesn't include Tags, I can only include changes to the podspec, someone with push access to the repository needs to create a corresponding CocoaPod version tag :)

    opened by joshjiav5 2
  • Dynamic Frameworks for iOS / OS X and Carthage Supports

    Dynamic Frameworks for iOS / OS X and Carthage Supports

    Hi, I make some big changes over the Versions Frameworks. Including:

    • Dynamic Frameworks for iOS / OSX.
    • make some internal Versions API as 'public'.
    • Clean the code a little bit.
    • Carthage Support

    Unfortunately, there are something I can't do / haven't do.

    • I haven't change the Podspec file. So It's doesn't support CocoaPods in these Branch
    • It seems Versions.framework is conflict with some other OS X Framework. So I have to use another framework name to avoid the problem.

    Due to the two problems I mention. I'm not expecting this pull request is going to be merge into the master branch of Versions Framework. I just want to open a discussion about Carthage Supports. I tried similar framework and prefer 'Versions', and I would love to use it in my app.

    Thank you.

    opened by remaerd 1
  • OSX platform support

    OSX platform support

    Versions works fine with OS X projects, but trying to install Versions via Cocoapods gives the following error:

    The platform of the target `Pods` (OS X 10.10) is not compatible with `Versions (0.4.0)`, which does not support `OS X`.
    
    opened by pkrll 0
Releases(0.5.0)
Owner
Christoffer Winterkvist
random hero at @finkoslo by day, cocoa vigilante by night, dad at dawn. my life is awesome. Previously @hyperoslo
Christoffer Winterkvist
A package manager that installs and runs executable Swift packages

Mint ?? A package manager that installs and runs Swift command line tool packages. $ mint run realm/[email protected] This would install and run SwiftL

Yonas Kolb 2k Jan 7, 2023
The Package Manager for the Swift Programming Language

Swift Package Manager Project The Swift Package Manager is a tool for managing distribution of source code, aimed at making it easy to share your code

Apple 9.1k Dec 29, 2022
Gradle plugin for managing Swift by enhancing Carthage with Maven repository

Works presents Athena Preface As a mobile application engineer that develops iOS and Android applications, I found that in Android, dependencies can b

Yunarta Kartawahyudi 1 Nov 3, 2020
NFCMate - A NFC Companion built using Swift with CoreNFC Framework

NFCMate NFCMate NFCMate is a NFC app written in Swift for iOS devices. Moreover,

Navemics 7 Nov 21, 2022
A framework for writing terminal applications in Swift.

Ashen A framework for writing terminal applications in Swift. Based on The Elm Architecture. As a tutorial of Ashen, let's consider an application tha

Colin T.A. Gray 79 Dec 5, 2022
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file

Swift Framework Template A template for new Swift Framework. What's in the template? Deployment Targets - iOS 9.0 / Mac OS X 10.10 / tvOS 9.0 / watchO

Rahul Katariya 529 Jun 27, 2022
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 31 Oct 4, 2022
DateHelper - A high performant Swift Date Extension for creating, converting, comparing, or modifying dates.

DateHelper A high performant Swift Date Extension for creating, converting, comparing, or modifying dates. Capabilities Creating a Date from a String

Melvin Rivera 1.4k Jan 2, 2023
UILabel subclass, which additionally allows shadow blur, inner shadow, stroke text and fill gradient.

THLabel THLabel is a subclass of UILabel, which additionally allows shadow blur, inner shadow, stroke text and fill gradient. Requirements iOS 4.0 or

Tobias Hagemann 654 Nov 27, 2022
This is a minimal AR Portal app that uses the RealityKit's occlusion materials to hide the inner space

AR Simple Portal This is a minimal AR Portal app that uses the RealityKit's occlusion materials to hide the inner space. Xcode 13.2.1 Target: iOS / iP

Yasuhito Nagatomo 6 Aug 10, 2022
📡 Helping you own NotificationCenter in Swift!

Notificationz ?? Helping you own NotificationCenter Highlights Keep Your Naming Conventions: This library gives you convenient access to NotificationC

Kitz 77 Feb 18, 2022
📡 Helping you own NotificationCenter in Swift!

Notificationz ?? Helping you own NotificationCenter Highlights Keep Your Naming Conventions: This library gives you convenient access to NotificationC

Kitz 77 Feb 18, 2022
CleanArchitecture - Helping project to learn Clean Architecture using iOS (Swift)

Clean Architecture Helping project to learn Clean Architecture using iOS (Swift)

Alliston 2 Dec 5, 2022
Unmutify: Helping mute people to talk

Unmutify Helping mute people to talk Important Links Demo Video Devpost Problem Statement Many people are unable to talk due to their disabilities & m

Seungjun 4 Nov 27, 2021
Helping mute people to talk

Unmutify Helping mute people to talk Important Links Demo Video Problem Statement Many people are unable to talk due to their disabilities & many peop

Dc7 0 Feb 26, 2022
Lightweight library helping to embed Mercuryo Widget into their mobile apps

Mercuryo-Widget Mercuryo Widget Wrapper is a lightweight library for developers of apps who embed Mercuryo Widget into their mobile UX. Solely purpose

Mercuryo.io 3 Apr 22, 2022
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

MindInventory 42 Oct 4, 2022
Are you bored? This app helps find you something to do via Bored api

Bored Swift Are you bored? This app helps find you something to do via Bored api Features Beautiful widgets ?? Simple and easy ✅ Open source ?? Previe

Armin Shalchian 29 Oct 11, 2022
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

Roy Marmelstein 4.7k Dec 29, 2022