react-native-vision-camera/package/ios/CameraView+Focus.swift
2023-11-27 14:43:56 +01:00

21 lines
450 B
Swift

//
// CameraView+Focus.swift
// VisionCamera
//
// Created by Marc Rousavy on 12.10.23.
// Copyright © 2023 mrousavy. All rights reserved.
//
import AVFoundation
import Foundation
extension CameraView {
func focus(point: CGPoint, promise: Promise) {
withPromise(promise) {
let normalized = previewView.captureDevicePointConverted(fromLayerPoint: point)
try cameraSession.focus(point: normalized)
return nil
}
}
}