Reveal common skills (translation from Reveal blog)

Source: Internet
Author: User

Translation from official website: http://revealapp.com/blog/reveal-common-tips-cn.html The following are based on reveal 1.6. Built-in applications for fast start-up

Just download reveal, what has not been configured, want to play a casual look at first, how to do?

We spent a lot of time developing a sample application ──soundstagram (audio-sharing version of Instagram,¯\_ (Mitsujo) _/¯) that is similar in complexity to the actual scenario, so that you can get the most out of your hand reveal and try out its various powerful features.

In the help menu item, click Inspect Sample app , wait a little while, reveal will copy the Soundstagram app to your iphone simulator, and automatically open the application, automatically connect to start Debug. With one click, you'll soon see the live reveal.

Integration

For a variety of ways to integrate reveal into your app, please refer to the official Chinese documentation, which has a detailed description of non-Guo (Yu).

In this case, for a professional iOS engineer (but even our designers have ruthlessly adopted this configuration), I personally strongly recommend using Xcode to add breakpoints in the way of integration reveal. A configuration, lifelong benefit, no matter to which project, is simply too convenient, there are wood. (minor flaws, this approach doesn't work when you disable breakpoints or use Appcode when you're not using Xcode.) )

Common shortcut keys

This is not a comprehensive list of shortcut keys, I only say something that is especially common.

shortcut Keys function
(Press in iphone simulator)?? R Switch to reveal and refresh
? → and? ← In the history of view selection, forward and backward
? ? Rolling Increase/decrease spacing of views per layer when 3D view
? 4 and? 5 Switch between 2D and 3D views
? R Refresh (mandatory syndrome)

heavy shortcut key user, please go to _help See the detailed list in Keyboard shortcuts.

Debugging of Automatic layout

Auto layout has become more and more common in many households, with the iOS device resolution of multiple (SUI)-like (Pian), automatic layout has slowly became the standard configuration.

    1. You may often see the console output something like this, without knowing where to start:
unable to simultaneously satisfy constraints. Probably at least one of the constraintsinchThe following list isOne you don't want. Try this: (1) look at each constraint and try to figure out which you don'T expect; (2Find the code that added the unwanted constraint or constraints and fix it. (Note:if you're seeing nsautoresizingmasklayoutconstraints that's you don'T understand, refer to the documentation forThe UIView property translatesautoresizingmaskintoconstraints) (        "<nslayoutconstraint:0x7fc82d3e18a0 h:[uiview:0x7fc82aba1210 (768)]>",        "<nslayoutconstraint:0x7fc82d6369e0 h:[uiview:0x7fc82aba1210]-(0)-| (Names: ' | ': UIVIEW:0X7FC82D6B9F80) >",        "<nslayoutconstraint:0x7fc82d636a30 h:|-(0)-[uiview:0x7fc82aba1210] (Names: ' | ': UIVIEW:0X7FC82D6B9F80) > ",        "<nslayoutconstraint:0x7fc82d3e7fd0 ' uiview-encapsulated-layout-width ' h:[uiview:0x7fc82d6b9f80 (]>) ") would attempt to recover by breaking constraint<nslayoutconstraint:0x7fc82d3e18a0H:[uiview:0x7fc82aba1210(768)]>Make a symbolic breakpoint @ uiviewalertforunsatisfiableconstraints toCatch  This inchThe debugger. The MethodsinchThe uiconstraintbasedlayoutdebugging category on UIView listedinch<UIKit/UIView.h> may also is helpful.

 
    1. In addition to the constraints (Constraints) We bind to the view at the time of encoding, many Uikit controls are implicitly set up with some constraints, which can lead to unexpected layout results.

Maybe once you need to use a LLDB little bit to debug auto Layouts:

(LLDB) PO0x7731880$0=124983424<uiview:0x7731880; frame = ( -- -; the  -); Layer= <calayer:0x7731450>>(LLDB) PO [0x7731880superview]$2=0x07730fe0<uiview:0x7730fe0; frame = ( +  -;259 604); Layer= <calayer:0x7731150>>(LLDB) PO [[0x7731880Superview] recursivedescription]$3=0x07117ac0<uiview:0x7730fe0; frame = ( +  -;259 604); Layer = <calayer:0x7731150>> | <uiview:0x7731880; frame = ( -- -; the  -); Layer = <calayer:0x7731450>> | <uiview:0x7731aa0; frame = ( - 101; the  -); Layer = <calayer:0X7731C60>>

With the reveal, this is much more convenient. Reveal the constraints on the view provides a fairly rich view and real-time modification of the function, the specific look at the following picture, and then explore their own a bit better.

A show/Hide all constraints
b View all constraints associated to this view
C You can select a constraint directly in the canvas
D View specific information about a constraint, you can modify the constant property in real time, check the effect immediately
e jump to the detailed property page of a constraint
Modify view properties in real time

Reveal is not just a tool for viewing various properties, it also supports real-time modification of some properties. As with most of the properties, you can see the modified effect in real time in the emulator. This eliminates the need to always modify the code and recompile to run this lengthy feedback process. This feature is especially efficient when you are experimenting with various display effects with the designer.

Snapshot

Reveal also has the function of saving the scene (shortcut key,? s), which will save the application's hierarchy of all view hierarchies and specific attribute information. In other words, the next time you open the snapshot file, you don't need to start the iOS app, or you can see all the view information.

Some possible usage scenarios: You can share snapshot with other team members when describing layout issues, or you can save snapshot for different size simulators, and then make a detailed comparison to find out where the problem lies.

Reveal common skills (translation from Reveal blog)

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.