The Lobe iOS-bootstrap app organizes view logic into the following objects:
PlayViewis the superview object, which handles rendering logic for bothCameraandImagePreviewmodes.PlayViewalso formats the location of overlayed buttons and labels in the frame.CameraViewis aUIViewControllerRepresentable, rather than aView. It manages a view controller which sets the video feed to the view frame, described in more detail here.ImagePreviewdisplays aUIImageas selected from theImagePickerphoto picker.ImagePickeris anotherUIViewControllerRepresentablewhich integratesUIImagePickerControllerDelegate, a UIKit delegate for handling selected images from an image picker. The selected image is used forImagePreviewmode.PredictionLabelViewdefines the view for the UI label displaying prediction text and confidence percentage.