解决方法
斯威夫特4
func isAppAlreadyLaunchedOnce()->Bool{ let defaults = UserDefaults.standard if let _ = defaults.string(forKey: "isAppAlreadyLaunchedOnce"){ print("App already launched") return true }else{ defaults.set(true,forKey: "isAppAlreadyLaunchedOnce") print("App launched first time") return false } }