Versions tracker for your iOS, macOS, and tvOS app

Overview

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.

You might also like...
A way to easily add Cocoapod licenses and App Version to your iOS App using the Settings Bundle
A way to easily add Cocoapod licenses and App Version to your iOS App using the Settings Bundle

EasyAbout Requirements: cocoapods version 1.4.0 or above. Why you should use Well, it is always nice to give credit to the ones who helped you 😃 Bonu

Automatically set your keyboard's backlight based on your Mac's ambient light sensor.
Automatically set your keyboard's backlight based on your Mac's ambient light sensor.

QMK Ambient Backlight Automatically set your keyboard's backlight based on your Mac's ambient light sensor. Compatibility macOS Big Sur or later, a Ma

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

A utility that reminds your iPhone app's users to review the app written in pure Swift.
A utility that reminds your iPhone app's users to review the app written in pure Swift.

SwiftRater SwiftRater is a class that you can drop into any iPhone app that will help remind your users to review your app on the App Store/in your ap

Small app that checks focus status under macOS 12
Small app that checks focus status under macOS 12

infocus What Small app for Mac Admins that checks focus status under macOS 11 and 12 and can be used to add Do Not Disturb support to management scrip

SwiftyUpdateKit is a framework for iOS and macOS.
SwiftyUpdateKit is a framework for iOS and macOS.

SwiftyUpdateKit is a framework for iOS and macOS. This framework supports for a user to update your app when new app version is released on the App Store.

Checks if there is a newer version of your app in the AppStore and alerts the user to update.
Checks if there is a newer version of your app in the AppStore and alerts the user to update.

YiAppUpdater Checks if there is a newer version of your app in the AppStore and alerts the user to update. Installation YiAppUpdater is available thro

An app that converts the temperature in Fahrenheit your input, and then changes to Celsius.

Swift Temperature Converter An app that converts the temperature in Fahrenheit your input, and then changes to Celsius. Things you need to do 📖 clone

Generate a privacy policy for your iOS app
Generate a privacy policy for your iOS app

PrivacyFlash Pro To easily run PrivacyFlash Pro get the latest packaged release. Learn more about PrivacyFlash Pro in our research paper. PrivacyFlash

Comments
  • public static func isFirstLaunch(forVersion version: String = Bool not correct">

    public static func isFirstLaunch(forVersion version: String = "", firstLaunch: FirstLaunch? = nil) -> Bool not correct

    let isFirstLaunch = VersionTracker.isFirstLaunch(forVersion: "1.0", firstLaunch: nil) isFirstLaunch always true when app start one more time.

    bug 
    opened by qiusuo8 3
  • Package.swift manifest is missing in 3.0.0

    Package.swift manifest is missing in 3.0.0

    Hi!

    I'm reporting the issue I'm having when trying to migrate from CocoaPods to Swift Package Manager (SPM). When I try to fetch the repository, with the latest version (3.0.0) I get this error:

    https://github.com/tbaranes/VersionTrackerSwift has no Package.swift manifest for version 3.0.0

    Also, this happens when trying to fetch this repository by that exact version.

    In case it helps, I'm using Xcode 12.4 and the rest of my dependencies work just fine with SPM.

    Thanks for your work!

    opened by vCrespoP 2
  • Fix iOS Build warning

    Fix iOS Build warning

    The platform specifications cause a build warning in Xcode 12. They're not necessary since VTS supports all versions supported by Xcode versions that support Swift Package Manager.

    Details in nanopb/nanopb#585, firebase/firebase-ios-sdk#6449, https://forums.swift.org/t/minimum-ios-version-xcode-12-and-build-warnings/40224, and https://github.com/apple/swift-evolution/blob/master/proposals/0236-package-manager-platform-deployment-settings.md

    opened by thislooksfun 1
  • Add Package.swift

    Add Package.swift

    Xcode 11 has built-in support for Swift Packages with no need for CocoaPods or Carthage, but this package does not have support for SPM. This PR adds that support.

    opened by thislooksfun 1
Releases(3.0.1)
  • 3.0.1(Dec 12, 2021)

  • 3.0.0(Mar 27, 2019)

  • 2.0.0(Apr 1, 2019)

    API breaking changes

    • Swift 4 and Xcode 9 support
    • Updating module name: VersionTrackerSwift -> VersionTracker
    • API cleanup, a few methods have been removed, and modified. Please check out the README to update your app

    Enhancements

    • Officially supporting Carthage

    Bugfixes

    • isFirstLanch for versions and builds are now working as expected
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Sep 11, 2016)

    API breaking changes

    • Module name VersionTracking has been renamed VersionTrackerSwift
    • VersionTracking has been renamed VersionTracker
    • Swift 3 support
    • Some APIs have been updated to be more swifty, check out the README for more information

    Enhancements

    • watchOS support
    Source code(tar.gz)
    Source code(zip)
  • 1.0(Feb 18, 2016)

Owner
Tom Baranes
👋
Tom Baranes
Easy way to detect iOS device properties, OS versions and work with screen sizes. Powered by Swift.

Easy way to detect device environment: Device model and version Screen resolution Interface orientation iOS version Battery state Environment Helps to

Anatoliy Voropay 582 Dec 25, 2022
Minecraft-silicon - Generate Apple Silicon-native versions of Minecraft

Minecraft Silicon A dead simple utility to generate Apple Silicon-native Minecra

Cole Feuer 4 Jun 21, 2022
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.

Mechanica A library of Swift utils to ease your iOS, macOS, watchOS, tvOS and Linux development. Requirements Documentation Installation License Contr

Alessandro 28 Aug 28, 2022
Easy CBOR encoding and decoding for iOS, macOS, tvOS and watchOS.

CBORCoding CBORCoding is a lightweight framework containing a coder pair for encoding and decoding Codable conforming types to and from CBOR document

Joe Newton 23 Nov 8, 2022
LanguageList for SwiftUI supporting iOS/macOS/tvOS

LanguageList for iOS, macOS and tvOS LanguageList is created and maintaned with ❥ by Sascha Muellner. What? This is a SwiftUI package with support for

Swift Package Repository 2 Jan 26, 2022
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.

SparrowKit Collection of native Swift extensions to boost your development. Support iOS, tvOS and watchOS. If you like the project, don't forget to pu

Ivan Vorobei 119 Dec 20, 2022
Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX)

Mission Control Super powerful remote config utility written in Swift (iOS, watchOS, tvOS, OSX) Brought to you by Have you ever wished you could chang

appculture 113 Sep 9, 2022
Add “Launch at Login” functionality to your macOS app in seconds

LaunchAtLogin Add “Launch at Login” functionality to your macOS app in seconds It's usually quite a convoluted and error-prone process to add this. No

Sindre Sorhus 1.3k Jan 6, 2023
Record your position and export your trip in GPX with GPS Stone on iOS.

GPS Stone Register your trips and export them as GPX files. Notes We currently have included a UIRequiredDeviceCapabilities with a location-services v

Frost Land 11 Sep 24, 2022
ALO sync allows you to sync resources form an ALO endpoint to your macOS file system.

ALO sync allows you to sync resources form an ALO endpoint to your macOS file system. Prerequisites macOS 11 No support for search* No suppor

Lawrence Bensaid 2 Jan 22, 2022