Giter Club home page Giter Club logo

appversion's Introduction

AppVersion

AppVersion是一个Swift Framework,适配Semantic Versioning 2.0.0版本号系统。

实现了如下协议:

  • Equatable
  • Comparable
  • CustomStringConvertible
  • StringLiteralConvertibleHashable

使用方法

AppVersion可以传入用'.'分割的版本字符串来实例化:

let version = Version(versionStringWithDot: "1.0.0")

或者直接用'.'分割的版本字符串直接转化:

let version : Version = "1.0.0"

AppVersion支持互相间的比较:

let appVersion : Version =1.2.3let newVersion : Version = getNewVersionFromAppStore()
if appVersion < newVersion {
    // You need upgrade
}

引入工程的方式

AppVersion 支持 CocoaPods。你只需要在你的Podfile中加入下面的设置:

use_frameworks!
pod 'AppVersion'

作者

卡爸,[email protected]

Todo

  • let version : Version = UIDevice.currentDevice().systemVersion
  • Version.SystemVersion
  • Version.AppVersion
  • let version : Version = Version(bundlePath: "Alamofire.framework")
  • version > "1.0.3"

License

Version is available under the MIT license. See the LICENSE file for more info.

appversion's People

Contributors

woshizilong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.