Search code examples
iosstoryboardaugmented-realityarkit

How to fit ARSCNView to SafeArea on iPhone X?


How can I fit an ARSCNView Object to fit on SafeArea for iPhone X with storyboard?


Solution

  • Select ARSCNView's top constraint (Scene View.top = top) and then in Size Inspector change a property called Second Item from Superview to Safe Area.

    enter image description here

    Now in Document Outline area it reads: Scene View.top = Safe Area.top.

    Constant = 0 This property is an offset.

    enter image description here

    Then choose View as: iPhone Xs at the bottom of Xcode:

    enter image description here

    Hope this helps.