react-native-vision-camera/ios/Parsers/AVCaptureDevice.TorchMode+descriptor.swift
Marc Rousavy 00c8970366 Add iOS
2021-02-19 16:28:05 +01:00

28 lines
461 B
Swift

//
// AVCaptureDevice.TorchMode+descriptor.swift
// Cuvent
//
// Created by Marc Rousavy on 18.12.20.
// Copyright © 2020 Facebook. All rights reserved.
//
import AVFoundation
extension AVCaptureDevice.TorchMode {
init?(withString string: String) {
switch string {
case "on":
self = .on
return
case "off":
self = .off
return
case "auto":
self = .auto
return
default:
return nil
}
}
}