Direct application in Xcode preview UI

Do app using Xcode application development time,UI interface design what application is commonplace,But every time and then run the simulator to view the output of a very troublesome thing,Especially when you need to modify many elements、And the need to fit a variety of screen sizes with the time - after all,,Now iPhone product line is no longer so a single。

So,Breath simulator to run three or four kind of thing I'm afraid it was only able to give you out。

In fact,Xcode is not did not give us a more convenient option - in the storyboard editing page,You can directly preview UI without the need to compile and run in the simulator。

Now,Let's create a sample project,The project I just added a little bit of basic elements as a demonstration,This is not a complete project。

The sample project
The sample project

This time I wanted to see if this looks like a real interface on the phone,In general, then compile and run using cmd + r,So Xcode will automatically call the simulator to show - if I want to see a preview on other models of the iPhone,Then I need to reselect the environment,Then compiled again,Considerable trouble。

Select UI Preview
Select UI Preview

As show in FIG.,We click on the box top left corner of the workspace,Then select the very end of the "Preview" in the menu that appears among,thenHold down the option + shift buttonThen click on it。

Double-click the plus sign with the mouse
Double-click the plus sign with the mouse

In the pop-up window which,We double-click on the right piece of green area with the mouse plus,This time you will find Xcode in the secondary window (default hidden) from the code into a preview area,This side is the default size of iPhone4s,You have been able to see a preview of your UI。

Other hide the sidebar,Let a little more visual space
Other hide the sidebar,Let a little more visual space

how is it,This preview,But oh no longer have immediate compiled code back and forth it!

To add another dimension screen preview,Just click on the lower left corner of the preview window "+" sign can be!

Screenshot 2015-05-21 5.47.43 PM

Original article written by Gerber drop-off:R0uter's Blog » Direct application in Xcode preview UI

Reproduced Please keep the source and description link:

By R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published. Required fields are marked *