iosswiftswift3material-uicosmicmind

Capture API: Continously change focus to the center of the screen and adjust exposure automatically


I am using https://github.com/CosmicMind/Material specifically the Capture API, which was basically a simplified AVFoundation framework.

My goal was to have the app reset focus every time the screen moves, specifically focusing on what's in the center of the screen all the time even if not tapping the screen.

Focus currently can be changed while tapping.

Just using the capture api using

guard let capture = captureController?.capture else {
        return
    }

Solution

  • Have you tried the open func focus(at point: CGPoint) function ? I would disable focus on tap with setting isTapToFocusEnabled to false, and then programmatically setting the focus using the above mentioned function.