Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - @property (assign) ClientDelegate #55

Open
cddiggs opened this issue Jun 24, 2017 · 0 comments
Open

iOS - @property (assign) ClientDelegate #55

cddiggs opened this issue Jun 24, 2017 · 0 comments

Comments

@cddiggs
Copy link

cddiggs commented Jun 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant