• 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: What is "TypeA -> TypeB"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is "TypeA -> TypeB"?


  • Subject: Re: What is "TypeA -> TypeB"?
  • From: Marco S Hyman <email@hidden>
  • Date: Thu, 02 Jul 2015 15:49:54 -0700

>
> I can write in-line handlers for this, but I'm trying to write a separate method, and just assign the method as a handler, and I can't seem to get the signature right.


It gets interesting when you want to also specify that the handler uses the
C calling convention to pass as a callback to legacy code.  AFAICT you can’t
do that using a function, but you can when assigning a closure to a variable.
The handler winds up looking something like

let handler: @convention(c) UnsafeMutablePointer<Void> -> Void = {
    arg in
    // ...
}


_______________________________________________

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: 
 >What is "TypeA -> TypeB"? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: What is "TypeA -> TypeB"?
  • Next by Date: Re: Problem having a framework working in one of my targets (a screensaver)
  • Previous by thread: Re: What is "TypeA -> TypeB"?
  • Next by thread: Translate curl command to NSURLRequest
  • Index(es):
    • Date
    • Thread