Example showing how to implement a usable expiring beta to macOS apps.
⚠️ It doesn't make sense to put the example setup directly into your project.
That's because you frequently will want to modify
BetaExpiration.swift. The library code has a hard-coded expiration date. You will want to change this with ongoing releases. To make this a Carthage or CocoaPods library would be useless.
There are two variants that'll work:
Whatever you do, it's important that you can easily change the expiration date in
BetaExpiration.expiresAt. You can compute the date by running the unit tests and looking at the console output.
BetaExpiration.guardExpiration()to show your e-mail address.
AppDelegate. This will display an alert and quit the app if the beta period is over.
The decoration is achieved by adding a
NSTitlebarAccessoryViewController to the window. The format is as follows:
β v1.2.0 (107) - 23 days left ^ ^ ^ | | |__ = (today - expiration date) | | | |__ build number | |__ version
You get all of this by calling
hostBundle should be your app's main
Bundle because that'll include version and build number information.
Copyright (c) 2017-2019 Christian Tietze. Distributed under the MIT License.