Quick Tip: Controlling the Camera Kit Sample UI

Options
aidan
aidan Posts: 32 🔥

Hi y'all,

I ended up spending too long trying to create a custom CameraView from the sample and found a much simpler solution to toggle and control the UI that's already there:

extension CameraView {

    func hideUI() {
        for view in [
            flashControlView,
            flashControlDismissalHint,
            toneMapControlView,
            toneMapControlDismissalHintLabel,
            portraitControlView,
            portraitControlDismissalHintLabel,
            cameraBottomBar,
            carouselView,
            cameraActionsView,
            cameraButton
        ] {
            view.isHidden = true
        }
    }
}

Just add this extension anywhere and call it from a function in your CameraViewController. In my case, I call it before I use applyLens

If you would like to keep any element like cameraButton just remove it from the list.

Hope this helps someone get started much faster!

Comments