chore: Cleanup void returns (#187)

* Place `return` in `return [void]` on separate line

* format

* Update CameraView+RecordVideo.swift

* f
This commit is contained in:
Marc Rousavy
2021-06-09 11:14:49 +02:00
committed by GitHub
parent 68a716b506
commit 16f2a7cdec
9 changed files with 110 additions and 73 deletions

View File

@@ -227,10 +227,12 @@ public final class CameraView: UIView {
internal final func setTorchMode(_ torchMode: String) {
guard let device = videoDeviceInput?.device else {
return invokeOnError(.session(.cameraNotReady))
invokeOnError(.session(.cameraNotReady))
return
}
guard var torchMode = AVCaptureDevice.TorchMode(withString: torchMode) else {
return invokeOnError(.parameter(.invalid(unionName: "TorchMode", receivedValue: torch)))
invokeOnError(.parameter(.invalid(unionName: "TorchMode", receivedValue: torch)))
return
}
if !captureSession.isRunning {
torchMode = .off
@@ -245,7 +247,8 @@ public final class CameraView: UIView {
return
} else {
// torch mode is .auto or .on, but no torch is available.
return invokeOnError(.device(.torchUnavailable))
invokeOnError(.device(.torchUnavailable))
return
}
}
do {
@@ -256,7 +259,8 @@ public final class CameraView: UIView {
}
device.unlockForConfiguration()
} catch let error as NSError {
return invokeOnError(.device(.configureError), cause: error)
invokeOnError(.device(.configureError), cause: error)
return
}
}