The camera delivers frames in the sensor's landscape orientation however
the phone is held, so in portrait the picture was 90 degrees off. Rotate
the capture connection: on iOS 17+ with a rotation coordinator, which
keeps the picture level with the horizon, and before that to match the
interface orientation.
A portrait frame doesn't fit the landscape size the game asks for, so
scale frames to cover it and crop the rest, rather than stretching.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frame was drawn at its own size into a context of the size the game
asked for, so the game got one corner of the picture. Also drop the
preview layer, which was never shown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Request an orientation update with setNeedsUpdateOfSupportedInterfaceOrientations
on iOS 16+, where attemptRotationToDeviceOrientation is deprecated.
- Open the document picker with UTTypes on iOS 14+, and present it from
sharedViewController rather than through the deprecated keyWindow.
- List cameras with a discovery session instead of devicesWithMediaType.
- IS_IPAD() instead of UI_USER_INTERFACE_IDIOM().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>