故事板与旧的XIB方式 [英] Storyboards vs. the old XIB way

查看:114
本文介绍了故事板与旧的XIB方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS新手,想知道哪个是最好的学习。我已经在这里阅读了一些答案,但是有些人说使用Storyboard会让其他人先说学习XIB。学习XIB有什么好处吗? XIB是否更容易理解并且对故事板有帮助?

I am new to iOS and was wondering which is the best to learn. I have read some of the answers here and SO, but some people say use Storyboards will others say learn XIBs first. Is there any real benefit to learning XIBs? Are XIBs easier to understand and will help with storyboards?

推荐答案

你可以用故事板做些事你不能做做一个笔尖。故事板允许您在视图控制器之间创建分段,并且它允许您就地设计表格视图单元格。

There are things you can do with a storyboard that you can't do with a nib. A storyboard lets you create segues between view controllers, and it lets you design table view cells in-place.

您可以使用笔尖执行某些操作用故事板做。在nib中,您可以创建对File的Owner占位符的引用。您可以创建多个顶级视图,编辑它们,并在它们之间创建连接。 查看此答案,了解您的原因示例我想这样做。您可以添加外部对象占位符(一种很少使用的功能)。

There are things you can do with a nib that you can't do with a storyboard. In a nib, you can create references to the File's Owner placeholder. You can create multiple top-level views, edit them, and create connections between them. See this answer for an example of why you'd want to do that. You can add external object placeholders (a rarely-used feature).

故事板的缺点是它们将一堆不同的,松散相关的对象收集到一个大文件中。如果您正在与多个开发人员合作开发一个项目,那么如果您使用的是故事板,那么与使用xib文件相比,您更有可能遇到合并冲突。

Storyboards have the drawback that they collect a bunch of different, loosely-related objects into one big file. If you're working on a project with several developers, you are much more likely to run into merge conflicts if you're using a storyboard than if you're using xib files.

你肯定应该在某个时候了解笔尖。无论您是想从它们开始还是从故事板开始,都可能不太重要。只需找到您喜欢的一些教程,并使用他们使用的任何类型的文件(笔尖或故事板)来完成它们。

You should definitely learn about nibs at some point. Whether you want to start with them or start with a storyboard is probably not too important. Just find some tutorials you like and work through them with whichever type of file (nib or storyboard) they use.

这篇关于故事板与旧的XIB方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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