chore: Update swiftlint to latest (#2398)

This commit is contained in:
Marc Rousavy 2024-01-16 18:01:41 +01:00 committed by GitHub
parent bdad4e1acb
commit 9c66a09582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View File

@ -5,6 +5,7 @@ disabled_rules:
- type_body_length - type_body_length
- cyclomatic_complexity - cyclomatic_complexity
- function_body_length - function_body_length
- for_where
opt_in_rules: opt_in_rules:
- contains_over_filter_count - contains_over_filter_count
- contains_over_filter_is_empty - contains_over_filter_is_empty

View File

@ -19,7 +19,7 @@ extension CameraSession {
ReactLogger.log(level: .info, message: "Configuring Input Device...") ReactLogger.log(level: .info, message: "Configuring Input Device...")
// Remove all inputs // Remove all inputs
captureSession.inputs.forEach { input in for input in captureSession.inputs {
captureSession.removeInput(input) captureSession.removeInput(input)
} }
videoDeviceInput = nil videoDeviceInput = nil
@ -57,7 +57,7 @@ extension CameraSession {
ReactLogger.log(level: .info, message: "Configuring Outputs...") ReactLogger.log(level: .info, message: "Configuring Outputs...")
// Remove all outputs // Remove all outputs
captureSession.outputs.forEach { output in for output in captureSession.outputs {
captureSession.removeOutput(output) captureSession.removeOutput(output)
} }
photoOutput = nil photoOutput = nil
@ -130,7 +130,7 @@ extension CameraSession {
// 2. Configure // 2. Configure
let options = codeScanner.options let options = codeScanner.options
codeScannerOutput.setMetadataObjectsDelegate(self, queue: CameraQueues.codeScannerQueue) codeScannerOutput.setMetadataObjectsDelegate(self, queue: CameraQueues.codeScannerQueue)
try codeScanner.options.codeTypes.forEach { type in for type in codeScanner.options.codeTypes {
// CodeScanner::availableMetadataObjectTypes depends on the connection to the // CodeScanner::availableMetadataObjectTypes depends on the connection to the
// AVCaptureSession, so this list is only available after we add the output to the session. // AVCaptureSession, so this list is only available after we add the output to the session.
if !codeScannerOutput.availableMetadataObjectTypes.contains(type) { if !codeScannerOutput.availableMetadataObjectTypes.contains(type) {
@ -151,8 +151,8 @@ extension CameraSession {
// pragma MARK: Video Stabilization // pragma MARK: Video Stabilization
func configureVideoStabilization(configuration: CameraConfiguration) { func configureVideoStabilization(configuration: CameraConfiguration) {
captureSession.outputs.forEach { output in for output in captureSession.outputs {
output.connections.forEach { connection in for connection in output.connections {
if connection.isVideoStabilizationSupported { if connection.isVideoStabilizationSupported {
connection.preferredVideoStabilizationMode = configuration.videoStabilizationMode.toAVCaptureVideoStabilizationMode() connection.preferredVideoStabilizationMode = configuration.videoStabilizationMode.toAVCaptureVideoStabilizationMode()
} }
@ -166,7 +166,7 @@ extension CameraSession {
// Set up orientation and mirroring for all outputs. // Set up orientation and mirroring for all outputs.
// Note: Photos are only rotated through EXIF tags, and Preview through view transforms // Note: Photos are only rotated through EXIF tags, and Preview through view transforms
let isMirrored = videoDeviceInput?.device.position == .front let isMirrored = videoDeviceInput?.device.position == .front
captureSession.outputs.forEach { output in for output in captureSession.outputs {
if isMirrored { if isMirrored {
output.mirror() output.mirror()
} }
@ -320,7 +320,7 @@ extension CameraSession {
} }
// Remove all current inputs // Remove all current inputs
audioCaptureSession.inputs.forEach { input in for input in audioCaptureSession.inputs {
audioCaptureSession.removeInput(input) audioCaptureSession.removeInput(input)
} }
audioDeviceInput = nil audioDeviceInput = nil
@ -340,7 +340,7 @@ extension CameraSession {
} }
// Remove all current outputs // Remove all current outputs
audioCaptureSession.outputs.forEach { output in for output in audioCaptureSession.outputs {
audioCaptureSession.removeOutput(output) audioCaptureSession.removeOutput(output)
} }
audioOutput = nil audioOutput = nil

View File

@ -13,7 +13,7 @@ extension AVCaptureOutput {
Mirrors the video output if possible. Mirrors the video output if possible.
*/ */
func mirror() { func mirror() {
connections.forEach { connection in for connection in connections {
if connection.isVideoMirroringSupported { if connection.isVideoMirroringSupported {
connection.automaticallyAdjustsVideoMirroring = false connection.automaticallyAdjustsVideoMirroring = false
connection.isVideoMirrored = true connection.isVideoMirrored = true
@ -31,7 +31,7 @@ extension AVCaptureOutput {
*/ */
func setOrientation(_ orientation: Orientation) { func setOrientation(_ orientation: Orientation) {
// Set orientation for each connection // Set orientation for each connection
connections.forEach { connection in for connection in connections {
#if swift(>=5.9) #if swift(>=5.9)
if #available(iOS 17.0, *) { if #available(iOS 17.0, *) {
// Camera Sensors are always in landscape rotation (90deg). // Camera Sensors are always in landscape rotation (90deg).