Cocoa: scene vs. view

我怕爱的太早我们不能终老 提交于 2019-12-20 06:26:53

问题


Noob question here. I think I get the basics of the three basic Model-View-Controller elements. Sort of. But what is a scene? I know iPad can have more than one scene per screen, and iPhone/iPod can have just one. But how does a scene relate to a view?

If I'm getting it horribly wrong, please be kind :)


回答1:


A "scene" is a UI abstraction Apple introduced into XCode to allow for storyboard mechanics in Interface Builder.

Prior to this, in Interface Builder, you created (and still can) Views which were attached to ViewControllers.

With Scenes, Segues and Storyboards, you have a way to define the UI flow from a view attached to a view controller (a scene) to another scene through a "segue". A segue being the action that you can visually define in Interface Builder as a trigger to move to another View (attached to a view controller)

At the abstract level a scene is a view attached to a view controller and you can have as many as you wish in a XIB whether it be for iPhone or iPad.

It really only depends whether you are in the storyboard editor or interface builder. You get an option on project creation to create storyboards for your new iOS project.



来源:https://stackoverflow.com/questions/13229990/cocoa-scene-vs-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!