アプリインストールの初回起動時のみユーザー名を登録する画面に遷移させようとして
・http://totutotu.hatenablog.com/entry/2015/02/24/【iOS】アプリの初回起動時のみ処理を行う方法【CoffeeNot[リンク内容](http://totutotu.hatenablog.com/entry/2015/02/24/【iOS】アプリの初回起動時のみ処理を行う方法【CoffeeNot)
・https://qiita.com/The_Shimon/items/6c3d6bcd6bfffbfd970d[リンク内容](https://qiita.com/The_Shimon/items/6c3d6bcd6bfffbfd970d)
を参照して以下のコードを書いたのですがエラーが出てしまいます。
swift
1//AppDelegate.swift 2 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 3 let defaults = UserDefaults.standard 4 5 if !defaults.bool(forKey: "firstLaunch") { 6 // Some Process will be here 7 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) 8 let nextView = storyboard.instantiateViewController(withIdentifier: "useRegiViewController") 9 present(nextView, animated: true, completion: nil)//Use of unresolved identifier 'present' というエラーが出る 10 // off the flag to know if it is first time to launch 11 defaults.set(true, forKey: "firstLaunch") 12 } 13 14 // Override point for customization after application launch. 15 return true 16 }
他にも
swift
1presentViewController(nextView, animated: true, completion: nil)
に変えてみたりしても同じエラーが出てしまいます。
このように初回起動時のみ別の画面に遷移するにはどうすれば良いのでしょうか。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/11 15:10