ストーリーボード未使用で開発しています。
UITabBarControllerを使った遷移と取得について分かりません。
やっている事 実現したい事
コード①にあるkonchiwaViewControllerにUIButtonを実装し、タップすると
modalViewController.modalTransitionStyle = .coverVertical present(modalViewController.modalTransitionStyle, animated: true, completion: nil)
でmodalViewControllerへ遷移します。
その後このmodalViewControllerでdismissした時に、UITabBarControllerのselectedViewControllerまで戻りたいです。
コード① let tabVc = self.presentingViewController as! UITabBarController let navigationVc = tabVc.selectedViewController as! UINavigationController let originVc = navigationVc.topViewController as! konchiwaViewController let origin2Vc = originVc. "ここがわかりません" as! modalViewController
やって見た事
コード①に下記コードを加えましたが、selectedViewControllerまで戻れません。
取得方法について教えていただきたいです。
よろしくお願いします。
origin2Vc.presentingViewController?.presentingViewController?.dismiss(animated: true, completion: nil)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。