看板 MacDev 關於我們 聯絡資訊
我想要app啟動的時候,判斷是否第一次使用app 如果是第一次使用,會跳到設定的ViewController 設定完之後跳到Main Interface的Entry ViewController 如果已經執行設定過,直接跳到Main Interface的的Entry ViewController 目前想法是在Launch Screen加判斷, 可是LaunchScreen.storyboard似乎不能設定他的UIViewController? 一直出現"Launch screens may not set custom classnames" 請問功能要怎麼設計? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.66.243.96 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1476862594.A.772.html
cryinglove: nav 去判斷 決定顯示哪一個 10/19 16:00
keith222: appdelegate的didfinishlaunchwithoption裡做判斷 10/19 16:03
cryinglove: 或者appdelegate didFinish 判斷 10/19 16:03
ssds: https://goo.gl/hZmWIk 我參考下面解答 希望有幫助:) 10/19 16:32
謝謝你的回覆^^ 我參考link內的code 如果在AppDelegate用 window?.rootViewController = BViewController() 可以呈現設定畫面,但是設定完之後無法關閉它回到MainViewController 在MainViewController的viewDidLoad()加入判斷然後show另外一個VC 出現錯誤 Warning: Attempt to present <BViewcontroller> on <MainViewController> whose view is not in the windows hierarchy. 如果是加在MainViewController的viewDidAppear可以present設定畫面 但是會有一瞬間先看到MainViewController的畫面 有沒有比較順暢的做法? ※ 編輯: sdico (61.66.243.96), 10/20/2016 09:35:22
howdiun: Main Interface改成空白 10/20 09:43
sdico: howdiun的意思是利用空白的頁面讓使用者看到不會感到怪異? 10/20 09:47
howdiun: 是不要設定Main Interface的意思XD,改成delegate指派 10/20 16:25
howdiun: 當然把main interface改成lauch screen也是可以啦 10/20 16:26