且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何关闭 SKScene?

更新时间:2022-02-20 21:59:21

"你不能从场景中回到视图控制器".场景是一个视图,视图控制器控制并显示视图.使用视图控制器来改变视图.记住视图控制器本身不是视图."-沃比奥

"You can't go "Back to the View Controller" from a scene. The scene is a View, the view controller controls and displays views. Use the view controller to change views. Remember the view controller itself is not a view." -Wharbio

这里***的解决方案是创建另一个视图控制器.这个视图控制器将是我的菜单.然后另一个 viewcontroller 将作为 skscene 的宿主.

Best solution here is to create another View Controller. This view controller will be my menu. Then the other viewcontroller will act as a host for the skscene.

在我的情况下,我然后使用我的菜单视图控制器关闭 skview 中显示的视图控制器.

In my situation I then use my menu viewcontroller to dismiss the viewcontroller displaying in the skview.