Comparison between handwritten code Ui,xib and storyboard

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.