Skip to content

Instantly share code, notes, and snippets.

@NikhilManapure
Created July 22, 2017 12:08
Show Gist options
  • Select an option

  • Save NikhilManapure/aaaa2aa30b21bc2d2e8dc3e23e2126f9 to your computer and use it in GitHub Desktop.

Select an option

Save NikhilManapure/aaaa2aa30b21bc2d2e8dc3e23e2126f9 to your computer and use it in GitHub Desktop.
extension AVCaptureDevice {
var hdrMode: HDRMode {
set(newValue){
switch newValue {
case .on:
automaticallyAdjustsVideoHDREnabled = false
isVideoHDREnabled = true
case .off:
automaticallyAdjustsVideoHDREnabled = false
isVideoHDREnabled = false
case .auto:
automaticallyAdjustsVideoHDREnabled = true
}
}
get {
if automaticallyAdjustsVideoHDREnabled {
return .auto
} else {
if isVideoHDREnabled {
return .on
} else {
return .off
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment