react-native-vision-camera/ios/Parsers/AVCaptureDevice.FlashMode+descriptor.swift

28 lines
461 B
Swift
Raw Normal View History

2021-02-19 08:28:05 -07:00
//
// AVCaptureDevice.FlashMode+descriptor.swift
// Cuvent
//
// Created by Marc Rousavy on 15.12.20.
// Copyright © 2020 Facebook. All rights reserved.
//
import AVFoundation
extension AVCaptureDevice.FlashMode {
init?(withString string: String) {
switch string {
case "on":
self = .on
return
case "off":
self = .off
return
case "auto":
self = .auto
return
default:
return nil
}
}
}