The goal is to incorporate PBJVision, an Objective-C library for capturing photos and videos, into a Swift app.
Unfortunately, we are seeing this error:
Objective-C method 'vision:capturedVideo:error:' provided by method 'vision(:capturedVideo:error:)' conflicts with optional requirement method 'vision(:capturedVideo:error:)' in protocol 'PBJVisionDelegate'
Here's the delegate method triggering the error:
func vision(vision: PBJVision, capturedVideo: NSDictionary, error: NSError) {
println("Encountered error during recording \(error)")
println("Captured video")
}
It seems like the problem was patched a while ago, but we are on the new version (i.e., changes mentioned are already incorporated) and still seeing the error.
Why is this happening, and how can we fix this?
It's simply a matter of translating Objective-C into Swift. The Objective-C declaration looks like this:
Therefore, to match it, your declaration should look like this: