I'm using ARKit to build an AR app with SceneKit. When I was creating an SCNPlane object when SceneKit detected a horizontal plane using ARPlaneAnchor's extent
of x
and y
properties I ran into this warning:
// *'extent' was deprecated in iOS 16*
My sample code is below:
let planeAnchor = anchor as! ARPlaneAnchor
let plane = SCNPlane(width: CGFloat(planeAnchor.extent.x),
height: CGFloat(planeAnchor.extent.z))
How can I work around this?
Use planeExtent property instead, with
width
,height
&rotationOnYAxis
sub-properties.In iOS 16.0 and higher,
extend
property is deprecated: