Ios 将ViewController推到与英雄动画一起显示的内部视图
标题几乎说明了一切。我有一个Ios 将ViewController推到与英雄动画一起显示的内部视图,ios,swift,model-view-controller,uiviewcontroller,uinavigationcontroller,Ios,Swift,Model View Controller,Uiviewcontroller,Uinavigationcontroller,标题几乎说明了一切。我有一个ViewController,我present它是这样的: let communityVC = self.storyboard?.instantiateViewController(withIdentifier: "CommunityVC") as! CommunityViewController communityVC.hero.modalAnimationType = .zoomSlide(direction: .right) let addB
ViewController
,我present它是这样的:
let communityVC = self.storyboard?.instantiateViewController(withIdentifier: "CommunityVC") as! CommunityViewController
communityVC.hero.modalAnimationType = .zoomSlide(direction: .right)
let addButtonHeroID = "addWishButtonID"
self.addButton.heroID = addButtonHeroID
communityVC.homeButton.heroID = addButtonHeroID
self.present(communityVC, animated: true, completion: nil)
问题是insicecomunityVC
我想推送另一个ViewController
。这有可能吗?我找不到真正有效的Swift
解决方案。在嵌入UINavigationController
后,您需要呈现communityVC
,然后您可以在communityVC
中推送视图控制器,这样您就可以使用navigationController?推送视图控制器(vc,动画:true)
fromcommunityV
let communityVC = self.storyboard?.instantiateViewController(withIdentifier: "CommunityVC") as! CommunityViewController
let navController = UINavigationController(rootViewController: communityVC)
communityVC.hero.modalAnimationType = .zoomSlide(direction: .right)
let addButtonHeroID = "addWishButtonID"
self.addButton.heroID = addButtonHeroID
communityVC.homeButton.heroID = addButtonHeroID
self.present(navController, animated: true, completion: nil)
线程1:“应用程序试图以模态方式呈现一个具有父视图控制器的视图控制器。”“哦,我自己也可以看到这一点……谢谢,伙计!像charmHey Piyush一样工作,您的解决方案工作得很好。但是当只需调用self.navigationController.push(someVC)时)
在另一个视图控制器中
像在modalView中一样推送它。如果要在另一个ViewController中使用默认推送动画,如何重置?