     }
     
 }
-
-extension AVCaptureDevice.Position {
-    
-    /// Checks if a camera device is available for a position.
-    ///
-    /// - Parameter devicePosition: Camera device position to query.
-    /// - Returns: `true` if the camera device exists, otherwise false.
-    public var isCameraDevicePositionAvailable: Bool {
-        return UIImagePickerController.isCameraDeviceAvailable(self.uikitType)
-    }
-    
-    /// UIKit device equivalent type
-    public var uikitType: UIImagePickerControllerCameraDevice {
-        switch self {
-        case .unspecified:
-            fallthrough
-        case .back:
-            return .rear
-        case .front:
-            return .front
-        }
-    }
-    
-}
-
-extension AVCaptureDevice.WhiteBalanceGains {
-    
-    /// Normalize gain values for a capture device.
-    ///
-    /// - Parameter captureDevice: Device used for adjustment.
-    /// - Returns: Normalized gains.
-    public func normalize(_ captureDevice: AVCaptureDevice) -> AVCaptureDevice.WhiteBalanceGains {
-        var newGains = self
-
-        newGains.redGain = Swift.min(captureDevice.maxWhiteBalanceGain, Swift.max(1.0, newGains.redGain))
-        newGains.greenGain = Swift.min(captureDevice.maxWhiteBalanceGain, Swift.max(1.0, newGains.greenGain))
-        newGains.blueGain = Swift.min(captureDevice.maxWhiteBalanceGain, Swift.max(1.0, newGains.blueGain))
-        
-        return newGains
-    }
-    
-}

            }
        }
        return false
    }
    
}

    
}

extension AVCaptureDevice {

    // MARK: - device lookup

    /// Returns the capture device for the desired device type and position.
    /// #protip, NextLevelDevicePosition.avfoundationType can provide the AVFoundation type.
