Should views be created using NIBs or code in iPhone?

前端 未结 6 1501
囚心锁ツ
囚心锁ツ 2021-02-06 18:04

Are there any performance, development drawbacks or advantages when designing views using Interface Builder?

6条回答
  •  清歌不尽
    2021-02-06 18:49

    One drawback is that it is easy to miss wiring up an outlet or action, and troubleshooting this can be painful. Two positives are that positioning, aligning, and anchoring UI elements is much, much easier, and elements redraw themselves when the phone is rotated (which is an animation process you would otherwise need to handle yourself with programmatic elements).

提交回复
热议问题