Latest 1.0.1
Homepage https://github.com/woshizilong/AppVersion
License MIT
Platforms ios 8.1, requires ARC
Authors

AppVersion AppVersion AppVersion 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.3”
let 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.

Latest podspec

{
    "name": "AppVersion",
    "version": "1.0.1",
    "summary": "Sample version system for App.",
    "description": "AppVersion is a Swift Library, compare version numbers.nThe representation is:n* Comparablen* Equatablen* StringLiteralConvertible",
    "homepage": "https://github.com/woshizilong/AppVersion",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "kaba": "[email protected]"
    },
    "social_media_url": "https://github.com/woshizilong",
    "platforms": {
        "ios": "8.1"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/woshizilong/AppVersion.git",
        "tag": "1.0.1"
    },
    "source_files": "AppVersion/**/*.{h,swift}"
}

Pin It on Pinterest

Share This