Latest 0.1.2
Homepage https://github.com/r-dent/RGAppVersion
License MIT
Platforms ios 8, requires ARC
Frameworks Foundation
Authors

Simple class for accessing the iOS app version and track app updates.

Installation

Just drag RGAppVersion.swift into your Project.

Or if you´re using CocoaPods, add this to your Podfile:

pod 'RGAppVersion'

Usage

RGAppVersion.currentVersion() gives you the current version of the app.
RGAppVersion.lastVersion() gives you the version of the app at last launch.

// Print the current installed app version.
print(RGAppVersion.currentVersion().combinedVersion)

// Print the last installed app version.
print(RGAppVersion.lastVersion())

// React on a new installation.
if RGAppVersion.appIsFreshInstalled() {
    print("New installation")
}

// React on app update.
if RGAppVersion.appWasUpdated() {
    print("App update from (RGAppVersion.lastVersion()!.combinedVersion) to (RGAppVersion.currentVersion().combinedVersion)")
}

Keep in mind that when you´re using RGAppVersion for the first time, it will always recognize a fresh installation.

Latest podspec

{
    "name": "RGAppVersion",
    "version": "0.1.2",
    "description": "Simple class for accessing the iOS app version and track app updates.",
    "summary": "Simple helper class for app versions.",
    "homepage": "https://github.com/r-dent/RGAppVersion",
    "authors": {
        "Roman Gille": "[email protected]"
    },
    "source": {
        "git": "https://github.com/r-dent/RGAppVersion.git",
        "tag": "v0.1.2"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "8"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true,
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This