基于现有的第二个 Interface Builder XIB 文件
我需要创建一些非常相似的视图 - 复制现有的 .xib,然后修改副本是好还是坏主意?即,这会导致循环引用或比其价值更多的麻烦吗?如果值得做,有没有办法从 XCode 中执行,或者需要从终端/文件管理器执行?我正在寻找一种快速生成非常相似的视图而无需从头开始重建的方法
I need to create a few Views that are very similar - would it be a good/bad idea just to copy the existing .xib, and then modify the copy? i.e. would that cause circular references or more hassles than it's worth? If it is worth doing, is there a way to do from within XCode, or do you need to do from terminal/file manager? I am looking for a way to quickly generate very similar views without reconstructing from scratch
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用相同的 xib 实例化多个 UIViewController 实例,然后对每个实例进行所需的任何更改。
等等...
如果需要,您还可以将 UIViewController 替换为 UIViewController 子类的名称。
You can just instantiate multiple UIViewController instances using the same xib, and then make any changes you want to each instance.
etc...
You can also replace UIViewController with the name of a UIViewController subclass if needed.