CosmicMind/Material SideMenu, how to change viewCo

2019-06-14 09:09发布

I am using CosmicMind/Material with a SideMenu, like in this example: here, but I can not figure out how to change (load) another view controller when I push a cell of the Menu.

To illustrate, in the example Material/Example/App, I would like to click on "inbox" and load the InboxViewController.

1条回答
叼着烟拽天下
2楼-- · 2019-06-14 09:53

To change the mainViewController area of the SideNavigationViewController, use the

transitionFromMainViewController

method.

You would also need a reference to the SideNav... and to get one from any UIViewController, you can use the Optional property

sideNavigationViewController?.transitionFromMainViewController(InboxViewController())

That's all it takes.

查看更多
登录 后发表回答