Mainly, a substantial refactor of the original view controller, which is decoupled from AV capture session responsibilities.
Improvements in UI controls
Because:
It's very difficult to interface AV capture logic from the SwiftUI layer if handled in UIKit (aka, our view controller). The workaround would involve very complicated delegation. Now, our view model manages AV capture logic—it's simpler to understand, easier to control, and easier to test.
This commit:
Refactors
Moved AV capture logic out of view controller and into CaptureSessionManager in the model layer
View controller reduced to setting view layer and handling rotation changes
Updated view model for Play view to manage changes for capture session including front/back cam toggling
UI changes
Added buttons for camera rotate and toggle between camera and image preview mode
Created new style for buttons which closely mimics desktop design
Created a debugging mode which displays the image used for inference, and can be toggled by editing environment variable in schemes
This PR does 2 things:
Because: It's very difficult to interface AV capture logic from the SwiftUI layer if handled in UIKit (aka, our view controller). The workaround would involve very complicated delegation. Now, our view model manages AV capture logic—it's simpler to understand, easier to control, and easier to test.
This commit:
CaptureSessionManager
in the model layerUI
Camera View
Image Preview
What's Next
Adding tests for Play view model.
Tagging #17