Skip to main content
←API Reference ←NSDK ←PlaybackCamera

viewportRect


Declaration​

func viewportRect(fittingIn drawableSize: CGSize, displayOrientation: UIInterfaceOrientation? = nil) -> CGRect

Summary​

Viewport rect that covers the drawable via aspect-fill, matching how NSDKView renders the camera background.
ARKit sensor images are always in landscape orientation.

Parameters​

NameTypeSummary
drawableSizeCGSize
-
displayOrientationUIInterfaceOrientation?
The current device interface orientation. When provided, the content aspect is computed for that orientation so the viewport fits the drawable when the device is in portrait or landscape. When nil, uses the frame's recorded orientation (backward compatibility).