• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing a swift function to objective-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Passing a swift function to objective-c (From: Kevin Meaney <email@hidden>)
 >Re: Passing a swift function to objective-c (From: Roland King <email@hidden>)
 >Re: Passing a swift function to objective-c (From: Kevin Meaney <email@hidden>)

  • Prev by Date: Re: Passing a swift function to objective-c
  • Next by Date: Creating a new OS X document in Swift
  • Previous by thread: Re: Passing a swift function to objective-c
  • Next by thread: Re: Passing a swift function to objective-c
  • Index(es):
    • Date
    • Thread