Run SwiftFormat in GH Action (#28)

This commit is contained in:
Marc Rousavy
2021-03-09 10:53:29 +01:00
committed by GitHub
parent 168ba054d1
commit 64bb6f6a2a
22 changed files with 383 additions and 234 deletions

View File

@@ -10,8 +10,10 @@ import AVFoundation
private var delegatesReferences: [NSObject] = []
// MARK: - PhotoCaptureDelegate
class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
private let promise: Promise
// MARK: Lifecycle
required init(promise: Promise) {
self.promise = promise
@@ -19,6 +21,8 @@ class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
delegatesReferences.append(self)
}
// MARK: Internal
func photoOutput(_: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
defer {
delegatesReferences.removeAll(where: { $0 == self })
@@ -66,4 +70,8 @@ class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
return promise.reject(error: .capture(.unknown(message: error.localizedDescription)), cause: error as NSError)
}
}
// MARK: Private
private let promise: Promise
}