I’m attempting to construct a customized digital camera in an iOS app written in SwiftUI. I’ve used the code from this publish precisely — simply copied and pasted it into my challenge to try it out. My ContentView
‘s physique consists of MyCameraView()
.
After I run the code, all I see is a white display and the black seize button (see hooked up picture). Can somebody please assist me appropriate this?
Upon doing a little testing, it seems as if the customCameraRepresentable
will not be being up to date after its declaration in MyCameraView
:
var customCameraRepresentable = CustomCameraRepresentable(
cameraFrame: .zero,
imageCompletion: { _ in }
)
The cameraFrame
stays being set to .zero
and the imageCompletion
stays being { _ in }
. And I consider that is what’s inflicting the issue. Nonetheless, I’m not positive how one can revise the code to repair this. Please advise.