Closed estebanjb1989 closed 2 years ago
Just copied the source folder to my project and added this method to SwiftyCamViewController:
@objc public func setZoomLevel(zoom: CGFloat) {
do {
let captureDevice = AVCaptureDevice.devices().first
try captureDevice?.lockForConfiguration()
zoomScale = zoom
captureDevice?.videoZoomFactor = zoomScale
DispatchQueue.main.async {
self.cameraDelegate?.swiftyCam(self, didChangeZoomLevel: self.zoomScale)
}
captureDevice?.unlockForConfiguration()
} catch {
print("[SwiftyCam]: Error locking configuration")
}
}
Hello! I've integrated SwiftyCam to my project and works awesome! But I'm having an issue with the zoom and I'd need to find a way to reset the zoom level to the default when the camera appears.
Do you know how can we achieve this?