Skip to content

Commit eed72c5

Browse files
author
Martin Stemmle
committed
Update version check example in README.md
1 parent f654290 commit eed72c5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,29 @@ let versionsTracker = iDontMindSingletons ? VersionsTracker.sharedInstance : Ver
8888

8989
switch versionsTracker.appVersion.changeState {
9090
case .installed:
91-
break
9291
// 🎉 Sweet, a new user just installed your app
9392
// ... start tutorial / intro
93+
print("🆕 Congratulations, the app is launched for the very first time")
9494

9595
case .notChanged:
96-
break
9796
// 😴 nothing as changed
9897
// ... nothing to do
98+
print("🔄 Welcome back, nothing as changed since the last time")
9999

100100
case .updated(let previousVersion: Version):
101-
break
102101
// 🙃 new build of the same version
103102
// ... hopefully it fixed those bugs the QA guy reported
103+
print("🆙 The app was updated making small changes: \(previousVersion) -> \(versionTracker.currentVersion)")
104104

105-
case .upgraded(let previousVersion: Version)
106-
break
105+
case .upgraded(let previousVersion):
107106
// 😄 marketing version increased
108107
// ... migrate old app data
108+
print("⬆️ Cool, its a new version: \(previousVersion) -> \(versionTracker.currentVersion)")
109109

110-
case .downgraded(let previousVersion: Version)
111-
break
110+
case .downgraded(let previousVersion):
112111
// 😵 marketing version decreased (hopefully we are not on production)
113112
// ... purge app data and start over
114-
113+
print("⬇️ Oohu, looks like something is wrong with the current version to make you come back here: \(previousVersion) -> \(versionTracker.currentVersion)")
115114
}
116115
```
117116

0 commit comments

Comments
 (0)