Giter Site home page Giter Site logo

gazadge / versiontrackerswift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tbaranes/versiontrackerswift

0.0 0.0 0.0 167 KB

Versions tracker for your iOS, macOS, and tvOS app

License: MIT License

Ruby 11.62% Objective-C 4.88% Swift 83.49%

versiontrackerswift's Introduction

VersionTrackerSwift

Travis Language CocoaPods Carthage compatible Platform

VersionTrackerSwift is a versions / builds tracker to know which version has been installed by a user.

Usage

In your ApplicationDelegate, call the method track to track the current version:

// iOS / tvOS
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    VersionTracker.track()
    return true
}
// macOS
func applicationDidFinishLaunching(aNotification: NSNotification) {
    VersionTracker.track()
    return true        
}

Then, call whenever one of the following methods to get the data you need:

VersionTracker.shared.track() 
VersionTracker.shared.isFirstLaunchEver // Bool
VersionTracker.shared.isFirstVersionLaunch // Bool
VersionTracker.shared.isFirstBuildLaunch // Bool
VersionTracker.shared.versionHistory // [String]
VersionTracker.shared.buildHistory // [String]

VersionTracker.currentVersion // String
VersionTracker.currentBuild // String

Check out the examples and play with the version / build / number to have a concrete example.

How it works?

Each time you call the method track, the version and build are stored in NSUserDefaults if a new version / build is detected. Then, you can access to any information from the tracker.

The version and build number are the information you specify in your app's Info.plist.

Installation

CocoaPods

Add the following line in your Podfile:

pod 'VersionTrackerSwift'

Carthage

Add the following line to your Cartfile:

github "tbaranes/VersionTrackerSwift"

Manual

Just drag the Source/*.swift files into your project.

Contribution

  • If you found a bug, open an issue
  • If you have a feature request, open an issue
  • If you want to contribute, submit a pull request

Licence

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

versiontrackerswift's People

Contributors

tbaranes avatar serejahh avatar el-fitz avatar rudedogg avatar thislooksfun 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.