You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.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
The text was updated successfully, but these errors were encountered: