Inspect a view controller, view, or constraint

Inspect the attributes of a view controller or view class

  1. Select a view or view controller on the canvas or in the Debug navigator.

  2. Open the Object inspector.

    The attributes are shown in the sections of the Object inspector:

    • Object. The class and memory address.

    • Class attributes. One section of the attributes for each class in the inheritance hierarchy of the selected view object. For example, a UIImageView contains a section titled Image for the attributes of the image view and a section titled View for attributes of the UIView.

    • Accessibility. The current accessibility settings, focus status, and description of the selected object.

    • Hierarchy. The inheritance hierarchy of the selected object.

Inspect the attributes of a constraint

  1. Select a constraint on the canvas or in the Debug navigator.

  2. Open the Object inspector.

    The attributes are shown in the sections of the Object inspector:

    • Object. The class and memory address.

    • Layout constraint. The values of the attributes.

    • Hierarchy. The inheritance hierarchy.

Inspect an allocation stack trace of a view object or constraint

  1. Select a view controller, view, or constraint on the canvas or in the Debug navigator.

  2. Open the Object inspector.

    The allocation stack trace is the last section in the inspector.

Note: To show a backtrace, set logging for malloc to All Allocation and Free History in the runtime diagnostics of the scheme editor.

Inspect the size and active constraints of a view object

  1. Select a view or view controller on the canvas or in the Debug navigator.

  2. Open the Size inspector.

    The information is shown in the sections of the Object inspector:

    • View. The frame and bounds rectangle, position in the parent, and the CALayer anchor point of the view.

    • Constraints. The runtime constraints. Implicit constraints added are shown in gray.

    • Content priorities. The runtime priorities for content hugging and content compression resistance.