大家不用 nib 开发 ios 界面的原因是啥?

2014-03-05 21:18:27 +08:00
 satanwoo
我只是最近和很多人聊到了这个,
原因如下:
(1)有些人说nib的复用性不高。
(2)有些人说nib只能开发静态初级的界面(比如关于,设置)
(3)有些人说nib不好合作。我认为这个现在xcode5在修改过nib的文件内容后,其实已经大大简化了。
(4) 最后点是我自己觉得的吧,读取nib是一次I/O操作,I/O可能会瓶颈吧。

不知道大家怎么看
5806 次点击
所在节点    iDev
29 条回复
chisj
2014-03-07 09:43:09 +08:00
(4) 最后点是我自己觉得的吧,读取nib是一次I/O操作,I/O可能会瓶颈吧。

------->这想法有点迫害妄想症
satanwoo
2014-03-07 10:11:17 +08:00
@chisj
是的。这是我一点乱猜的。。
l6751902
2014-03-07 10:30:07 +08:00
习惯不习惯的问题而已,
还有一个问题就是机器性能不行用interface builder很痛苦
wupher
2014-03-07 11:16:11 +08:00
就我个人而言,sb有些功能的实现上面可以少写和不写代码。
BTW:OSX开发到现在仍然是只能支持XIB的。
offspring
2014-03-07 15:14:52 +08:00
@satanwoo 我哪里急了... 有可以降低复杂度的干嘛不用 而且universal的挺多的 你看evernote dropbox reeder等等不都是universal的么 而且我觉得如果没在真实的项目里使用过也不好意思说到底好不好用吧 就像有些人现在还不用ARC呢 他也能说出一堆道理
clovelu
2014-03-07 15:54:44 +08:00
调试的时候代码要方便很多,比如调个背景颜色,如果是xib,你还得要进入到xib,找到对应view还调。来回却换非常痛苦。
R0CKSTAR
2014-04-10 14:46:14 +08:00
SB/XIB + UISS(https://github.com/yeahdongcn/UISS) 很爽的
问题就是多个人一块开发的时候merge很麻烦
R0CKSTAR
2014-04-11 09:39:56 +08:00
Compilerrr
2014-10-14 17:49:58 +08:00
What we're doing is as follows:

We're ignoring the iPad specific storyboard that Xcode sets up for us.

We have a single storyboard for both iPad and iPhone. So far ALL the scenes are shared between them. If we need to create a custom scene for iPad at any point, we'll create a separate scene and give it an identifier with the suffix _iPad. Then we'll write code to load that at runtime. (The app uses a scheme where it instantiates view controllers from a descriptor file, and uses unique IDs instead of segues.)

Storyboards are the wave of the future. Many of Apple's new tricks are built on storyboards, and don't work with XIBs, or are much harder to use with XIBs.

As a simple example, iOS 6 has embed segues, which make it PAINLESS to create parent/child view controller relationships. Without that, you have a fair amount of rather fussy code to write. Certain view controllers like table view controllers pretty much have to be child view controllers (since a table view controller's root view is a table view, it doesn't lend itself to managing other UI elements)

I put off learning storyboards for quite a while, and regret that I did.
http://www.agileinfoways.com/technical-expertise/mobile-applications-development/iphone/

Overall they are easier to use, enable new features, and are well worth it. I was productive with storyboards almost instantly.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/103010

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX