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.
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.hBefore 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.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