ios - Error bridging Obj-C code and Swift: method "U" provided by method "Z" conflicts with optional requirement method "X" in protocol "Y" -
the goal incorporate pbjvision, objective-c library capturing photos , videos, swift app.
unfortunately, seeing error:
objective-c method 'vision:capturedvideo:error:' provided method 'vision(:capturedvideo:error:)' conflicts optional requirement method 'vision(:capturedvideo:error:)' in protocol 'pbjvisiondelegate'
here's delegate method triggering error:
func vision(vision: pbjvision, capturedvideo: nsdictionary, error: nserror) { println("encountered error during recording \(error)") println("captured video") }
it seems problem patched while ago, on new version (i.e., changes mentioned incorporated) , still seeing error.
why happening, , how can fix this?
it's matter of translating objective-c swift. objective-c declaration looks this:
- (void)vision:(pbjvision *)vision capturedphoto:(nullable nsdictionary *)photodict error:(nullable nserror *)error;
therefore, match it, declaration should this:
func vision(vision: pbjvision, capturedvideo videodict: [nsobject : anyobject]?, error: nserror?) { // ... }
Comments
Post a Comment