可可:场景vs.视图 [英] Cocoa: scene vs. view

查看:133
本文介绍了可可:场景vs.视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是Noob的问题。我想我得到了三个基本的Model-View-Controller元素的基础。有点。但是什么是场景?我知道iPad每个屏幕可以有多个场景,而iPhone / iPod可以只有一个。但是场景如何与视图相关?

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 :)

推荐答案

场景是Apple在XCode中引入的一个UI抽象,允许在Interface Builder中使用故事板机制。

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

在此之前, (仍然可以)附加到ViewControllers的视图。

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

通过场景,Segues和Storyboards,您可以从附加到视图的视图定义UI流控制器(场景)通过segue到另一个场景。一个segue是您在Interface Builder中可视化定义的一个动作,作为移动到另一个View(附加到一个视图控制器)的触发器。

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)

在抽象层, strong>是附加到视图控制器的视图,并且您可以在XIB中使用任意数量的视图,无论是iPhone还是iPad。

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.

真的只取决于你是在故事板编辑器还是界面生成器。您可以在项目创建时选择为新的iOS项目创建故事板。

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.

这篇关于可可:场景vs.视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆