2021-02-19 08:28:05 -07:00
|
|
|
//
|
|
|
|
// AVCaptureDevice.FlashMode+descriptor.swift
|
2021-06-21 14:42:46 -06:00
|
|
|
// mrousavy
|
2021-02-19 08:28:05 -07:00
|
|
|
//
|
|
|
|
// Created by Marc Rousavy on 15.12.20.
|
2021-06-01 05:07:57 -06:00
|
|
|
// Copyright © 2020 mrousavy. All rights reserved.
|
2021-02-19 08:28:05 -07:00
|
|
|
//
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|