Re: Passing a swift function to objective-c
Re: Passing a swift function to objective-c
- Subject: Re: Passing a swift function to objective-c
- From: Quincey Morris <email@hidden>
- Date: Fri, 17 Oct 2014 18:01:03 +0000
On Oct 17, 2014, at 09:59 , Kevin Meaney <email@hidden> wrote:
>
> I got the assigning to a property working when that property was declared as part of the class, but not when it has been declared in the optional section of a protocol. So I was able to duplicate what you did Roland. But no matter what I try, documentation I read I can't make it work when the property is declared in the protocol.
Presumably, the issue is that Swift makes assumptions about the possibility of a nil value when translating Obj-C frameworks types in a header. I believe that trying to guess the Swift translation from the Obj-C declaration will just drive you into madness. What you need to do instead is examine the translated declaration. Try Command-clicking on the protocol name in the place where you declare conformance, and you should see the translation. Then mimic the block type you see there.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden