     private let notificationCenter: NotificationCenter
     private let application: UIApplication
     private let imageManager: PHImageManager?
+    fileprivate let photoLibrary: PHPhotoLibrary
     
     /**
      Initializes a `ScreenshotDetector` with its dependencies. Note that `ScreenshotDetector` requires access to the user’s Photo Library and it will request this access if your application does not already have it.

        }
    }
    
    private func findScreenshot() {
        guard let screenshot = PHAsset.fetchLastScreenshot() else { fail(with: .fetchFailure); return }
        
        // Fall back to the `.default()` image manager if an image manager wasn’t set on initialization.

        return options
    }
}

extension ScreenshotDetector: PHPhotoLibraryChangeObserver {
    
    // MARK: - PHPhotoLibraryChangeObserver
    
    public func photoLibraryDidChange(_ changeInstance: PHChange) {
        photoLibrary.unregisterChangeObserver(self)
        findScreenshot()
    }
}
