Stroyboard (visual Interface) and pure code

Source: Internet
Author: User

Stroyboard is a new technology introduced by Apple in IOS 5, which makes pure code a visual interface, with NIB, xib a more intuitive display, a control with dozens of lines or even hundreds of lines of code, and now you can just move your finger to complete a control. The vast majority of beginners learn to teach you how to use storyboard instead of using pure code, but I myself prefer the pure code, always feel that the code I knocked out more can be trusted, the changes will be more simple.

At first I thought that the pure code and visual interface is actually the same, look at a person likes to choose what method, and later looked up the data found that if it is a large project, with a visual interface, then the team can not coordinate the completion of the task, but the pure code is so capricious, and more people can be coordinated to complete, The visual interface can be used in small places, such as Xib, using Xib to make a book display view.

Well, gossip not much to say, now to introduce the next storyboard. The essence of StoryBoard is an XML file that describes key information such as forms, components, Auto Layout constraints, and so on. However, we should recognize a more important essence: iOS projects that use StoryBoard initialize the Stroyboard file as an initialization entry for the entire program, and the Uiviewcontroller class is initialized by the StoryBoard binding. To start running.

This piece of red is not modified the size of the original Stroyboard, beginners do not learn the constraints before you need to manually modify its size, select the view Controller, hold opt + cmd + 4, on the right side will appear simulated Metrics, Find the size inside and choose the iphone 4.7-inch so that his size becomes a screen that fits the iphone 6 iphone 6S.

Is all the controls in Xcode, left-click and drag on the Stroyboard, cmd + R can be seen on the emulator that you dragged the control to display. is not particularly simple.

Stroyboard There are a lot of things to study on their own, Master led the door, practice by personal, a lot of things to see a half-day listening to the half-day, also not necessarily have you write a line of code, do your own doing a good job.

Auto Layout

Finally pull a pull on auto Layout, this with Stroyboard is the day and, with tacit understanding, can greatly improve the UI development efficiency, one-time to make the UI suitable for all screen size, do not need to use a frame a calculation, will be very troublesome, to slowly debug, And the visual interface is not necessary, you can see directly, but set the constraints also need to practice their own to make perfect.

Stroyboard (visual Interface) and pure code

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.