session(_:didChangeViewRotationAngle:)
This is called when the view rotation angle changes.
Declaration
optional func session(_ session: ARSession, didChangeViewRotationAngle viewRotationAngle: CGFloat)Parameters
- session:
The session that provides the angle.
- viewRotationAngle:
The angle, in degrees, normalized to
[0, 360)(0at LandscapeRight,90at Portrait,180at LandscapeLeft, and270at PortraitUpsideDown).
Discussion
ARKit calls this method when a new angle becomes available, in step with the system UI rotation. Implement it to rotate a view by the given angle so the ARFrame it displays stays level with the horizon as the device rotates.