abbyy / ocrsdk.com

ABBYY Cloud OCR SDK
http://ocrsdk.com/github
Apache License 2.0
504 stars 484 forks source link

iOS - @property (assign) ClientDelegate #55

Open cddiggs opened 7 years ago

cddiggs commented 7 years ago

I've bridged the Objective C files with a Swift project. I was able to bridge everything correctly. However, I was having issues with executing the delegate methods in Swift. In order to invoke the delegate methods, I had to change @property (assign) id<ClientDelegate> delegate; to @property (strong, nonatomic) id<ClientDelegate> delegate; in Client.h

Before I made this change, the delegate methods weren't getting invoked in the Swift code at all.
In other words, the respondsToSelector methods always returned false.

if ([self.delegate respondsToSelector:@selector(clientDidFinishUpload:)]) {
    [self.delegate clientDidFinishUpload:self];
}

I'm no expert at Objective C and I'm not entirely sure this is a defect (considering I'm bridging the Objective C source with Swift). I wanted to make sure this change was correct for my scenario.

Please advise. Thanks in advance. Chris