开发者

pushViewController in a UINavigationController from a different View Controller

开发者 https://www.devze.com 2023-03-28 16:57 出处:网络
I have a screen in my iPhone application where i have to load multiple kinds of data simultaneously. To simplify my code, I created separate view and loaded separate view controllers in them to handle

I have a screen in my iPhone application where i have to load multiple kinds of data simultaneously. To simplify my code, I created separate view and loaded separate view controllers in them to handle each set of data. The blue rectangle on the top has a separate VC and the blue square(ish) below it has another VC that has a navigation controller. All is going well until I suddenly need to push a viewcontroller onto my stack in one VC if user taps on the view that is handled by a different VC.

开发者_如何学C

pushViewController in a UINavigationController from a different View Controller


You could add a property to each "sub" view controller where you could set a UINavigationController. Set the UINavigationController from the "container" view for each "sub" view controller and use this navigation controller instance to push other view controllers.

0

精彩评论

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

关注公众号