Search code examples
xcodeframeboundscgrectcgpoint

Xcode -User Interface Inspector Position X and Position Y values?


Using the Xcode User Interface Inspector what are the Position x and Position y values?

If you look at my picture, the frame I'm inspecting starts at CGPoint 0,0 and it's bounds are 0,0.

What does the 207 and 327.222 correspond to?

enter image description here


Solution

  • I would guess that is the view's backing layer position. Since positions of CALayers are referring to their center, the values are practically half of the size you get on the inspector (414 / 2 = 207 & 654.67 / 2 ≃ 327). My guess is based on the Z Position which is also a property of a layer.

    EDIT: After some search at Apple's documentation, this property is described as "Position in the parent" (click on "View debugger size inspector") which is quite confusing since this is (when talking about views) the frame's origin.