In UI authoring, gradually differentiate three main genres: Use the code handwriting UI, organize Viewcontroller or view with a single xib file, and use storyboard to build the UI from a single or few files. Three ways each have their own merits and demerits, but also each has its own most suitable occasions.
First, the Handwriting code UI
1. Advantages
√ Large-scale project-wide use for version management, tracking changes, and code merging
√ Best code re-usability
2. Regret
√ Slow, long development cycle, complex maintenance code
√ Automatic layout AutoLayout Difficult
Second, xib file organization Viewcontroller or view
1. Advantages
√ Fast development speed
√ The difference between version management and pure code is not very large, easy to read and easy to maintain
2. Regret
The settings in √xib are often not final, and UI design is overwritten by code
(If you choose Xib, try to isolate the work of xib from the work of your code: You can use Xib to do what you xib, instead of saying three labels where two fonts are set in Xib and the other is done in code.) It would be a good way to try to keep only the necessary, less iboutlet and ibaction. )
Third, StoryBoard
1. Advantages
√ You can see the layout style of each viewcontroller, or you can clearly know the conversion relationship between each Viewcontroller
√ Low code volume and short development cycle
√ The key is to become the default configuration for new projects, which represents the future direction and center of gravity of Apple.
2. Regret
√ It's hard to collaborate with many people
√viewcontroller reuse and the processing of custom view
Comparison between handwritten code Ui,xib and storyboard