开发者

NavController push from subview

开发者 https://www.devze.com 2023-04-04 22:21 出处:网络
I got an application with a tabbar and a navigation controller for one of the tab view. The Navigation controller is pushing several views and one of them has a button which permits to add a subview (

I got an application with a tabbar and a navigation controller for one of the tab view. The Navigation controller is pushing several views and one of them has a button which permits to add a subview (I am actually displaying a popup message -not an uialert- when pushing that button).

The problem is that I would like now to be able to push a new view controller once I pushed a button in the subview...

I cannot find my navcontroller, even when I use the pushmethod of a开发者_开发问答ppdelegate.tabbar.navigationController

Does one of you have easy idea about how to implement that ?

Thanks a lot !


If the button's press action of the second button is being handled in the same UIViewController as the other button's action you should simply be able to use

[self.navigationController pushViewController:newViewController animated:YES];.

If your subview has it's own UIViewController you could add a reference to your first UIViewController or to the navigationController itself and use it that way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号