Code handwriting UI, Xib, and storyboard each have their limitations

Source: Internet
Author: User

Code:because you can't visually see the results you can get, you probably need to constantly cmd+r/cmd+. To modify the position size of each view. Even if you use tools such as reveal or restartlessoften, you will not be able to easily complete the layout you need. Plus, if you need to use AutoLayout for size adaptation, it's even more frustrating to use code to constrain it. Many times an unsatisfied constraint problem is enough to run back and forth to modify debugging for a long time. Xib:when using Xib, it is almost inevitable to complement and complete functionality with part of the code. On this point in the development should be highly valued, if you choose Xib, then try to isolate the work of xib and the work of the code: the ability to use Xib to complete the content of the unified use of xib to do, not to say three labels two of them in the Xib set the font and the other is in the code to complete. It would be a good way to try to keep only the necessary, less iboutlet and ibaction. Storyboard:because the existence of a single view is not allowed in storyboard, many times we still need to customize the UI with a single xib. This is due to the storyboard design ideas, storyboard more emphasis is a hierarchy, is a global perspective on the organization of UI design and migration. For a single view, more attention is paid to reuse and customization than to the entire project's process. I believe that by seizing this point, you will be well aware of when to use Xib and when to use storyboard.

Code handwriting UI, Xib, and storyboard each have their limitations

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.