         delegate?.screenshotDetector(self, didDetectScreenshot: image)
     }
     
-    private func fail(_ error: Error) {
+    private func fail(with error: Error) {
         delegate?.screenshotDetector(self, didFailWithError: error)
     }
 }

                case .authorized:
                    self.findScreenshot()
                case .denied, .notDetermined, .restricted:
                    self.fail(.unauthorized(status: authorizationStatus))
                }
            }
        }
    }
    
    private func findScreenshot() {
        guard let screenshot = PHAsset.fetchLastScreenshot() else { fail(.fetchFailure); return }
        
        imageManager.requestImage(for: screenshot,
            targetSize: PHImageManagerMaximumSize,

            options: PHImageRequestOptions.highQualitySynchronousLocalOptions()) { [weak self] image, info in
            OperationQueue.main().addOperation {
                guard let strongSelf = self else { return }
                guard let image = image else { strongSelf.fail(with: .loadFailure); return }
                
                strongSelf.succeed(with: image)
            }
