                    }
                }
             }
-            
+
             if let bestFormat = bestFormat,
                let bestFrameRateRange = bestFrameRateRange {
                 do {
                     try device.lockForConfiguration()
-                    
+
                     // Set the device's active format.
                     device.activeFormat = bestFormat
-                    
+
                     // Set the device's min/max frame duration.
                     let duration = bestFrameRateRange.minFrameDuration
                     device.activeVideoMinFrameDuration = duration
                     device.activeVideoMaxFrameDuration = duration
-                    
+
                     device.unlockForConfiguration()
                 } catch {
                     // Handle error.

            }
        }
    }
    
}

// MARK: - video capture

                }
                return false
            }

        }
    }
