how can I make the uiviewcontroller visible only once during first run of the app (e.g. tutorial)?

后端 未结 3 1505
攒了一身酷
攒了一身酷 2020-12-29 16:01

I\'m creating an iOS swift app and I want to show tutorial screen when user runs the app for the very first time. Later on, with each run of the app the tutoria

3条回答
  •  忘掉有多难
    2020-12-29 16:49

    For swift 4 make these changes.

    let defaults = UserDefaults.standard
    if defaults.object(forKey: "isFirstTime") == nil {
        defaults.set("No", forKey:"isFirstTime")
        defaults.synchronize()
        ...
    }
    

提交回复
热议问题