每个版本的 App 第一次被用户打开时,展示 launch 页面:
let hasLanchedForVersionKey = "HasLaunchedForVersion"
let currentVersion = 3
if NSUserDefaults.standardUserDefaults().integerForKey(hasLanchedForVersionKey) < currentVersion {
NSUserDefaults.standardUserDefaults().setInteger(currentVersion, forKey: hasLanchedForVersionKey)
NSUserDefaults.standardUserDefaults().synchronize()
// This is the first lanch for this version
// ...
} else {
// App hasn't been updated since last launch
}