Storyboards Tutorial 01

Storyboarding 是在ios 5时候引进入的一个非常出色的特性。节省了为app创建user interfaces的时间。

如果你的app有多个屏幕storyboards可以帮助你降低代码的粘合度。比如从一个屏幕进入到另外一个屏幕。不会为每一个view controller使用单独的nib文件。你的app将只使用一个storyboard就可以包含所有这些view controllers的设计和关系。

storyboard有很多优势:

可以对所有app中的屏幕以及他们之间的关系有个更好的概念上的概览。更容易跟踪一切因为整个设计是在单独的一个文件中。而不是分成多个独立的nib文件。

storyboard描述了不同屏幕间的传输。这些传输称为segues并且只要通过简单的ctrl-dragging从一个view controller到另一个就可以建立了。由于segues的存在减少了代码量

storyboard使得table view的设计和使用更加方便。包含了cels和static sells features和属性。

还可以讲storyboard和nib文件混用

Storyboards tutorial: iOS 7 style

打开xcode创建新的工程,使用single view applicaiton模版。

并填写如下的选项

  • Product Name: Ratings
  • Organization Name: fill this in however you like
  • Company Identifier: the identifier that you use for your apps, in reverse domain notation
  • Class Prefix: leave this empty
  • Devices: iPhone

之前版本的xcode需要特别指出是否使用storyboards,但是xcode5不再有这个选项,storyboards默认可用。

创建完成后是下面这个样子:

你可能感兴趣的:(RIA)