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
- cyclomatic_complexity
- function_body_length
- for_where
opt_in_rules:
- contains_over_filter_count
- contains_over_filter_is_empty

View File

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

View File

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