推 s001582000: 加到陣列隨機取 06/30 09:51
阿 我的問題點是 presented view controller 有什麼方法可以不要嘛
最近發現 跳轉不管是 showViewController 或是 presentViewController
都會把目前的 ViewController 壓入 presented stack 中
想說有沒有方法可以跳轉又可以不要壓入 presented stack 中的
※ 編輯: sorkayi (36.233.22.57), 06/30/2018 10:03:38
推 s001582000: uinavigationcontroller的push vc 06/30 10:51
不過不是有 push 就需要 pop 嘛?
※ 編輯: sorkayi (114.46.225.242), 06/30/2018 11:55:44
推 s001582000: 那就剩下uitabbar了嗎 在把bar隱藏 06/30 12:00
這個方法好像也可以參考看看 改天來練習看看好了
→ Esvent: 如果沒有用navigationController或tabBarController的話 06/30 13:55
→ Esvent: 直接切換keyWindow的rootViewController即可 06/30 13:56
→ Esvent: 有用上述兩種容器的話 也可以直接設定他們的stack 06/30 13:56
→ Esvent: 可以參考一下 -setViewControllers:animated: 06/30 13:57
對 我一開始也都是用這個方法在做切換
想說過了這麼久 會不會有比較新的方法 沒想到還是找不到
→ shinrenpan: appDelegate.window.rootViewController = newVC, 不 06/30 17:35
→ shinrenpan: 過在某些 iOS 版本會有記憶體問題. 06/30 17:35
這個很久以前也是這樣寫 偶爾會 Mem leak 的樣子
後來我都 addChildView 了 實在是寫的很亂 >///<
※ 編輯: sorkayi (114.46.218.116), 06/30/2018 18:21:21
→ bluewind125: 在上一層的presenting 實作A B C D E的換頁 06/30 20:50
→ bluewind125: 先dismiss無動畫 completion再present 06/30 20:52
不過我發現 UITransitionView 會一直疊加上去
看 記憶體也會一直加上去 好恐怖 不知道是不是我寫法有問題就是了
※ 編輯: sorkayi (114.46.226.147), 06/30/2018 22:28:42
→ shinrenpan: tabBarController或自製類似模式的ViewController 06/30 22:33