lukaskollmer / objc

🔮 NodeJS ↔ Objective-C bridge (experimental)
MIT License
100 stars 20 forks source link

Delegates? #3

Closed jmbldwn closed 6 years ago

jmbldwn commented 6 years ago

Bravo for doing this. I'm jonesing to pass in a delegate that ends up as a callback/event in JS. I see you support blocks; is there a way to define a delegate?

lukaskollmer commented 6 years ago

the only way to use objc-style delegates is by creating a custom class which implements the methods declared in the delegate's protocol.

see this for an example implementation for NSFileManagerDelegate and this for a general example on how to create a custom class

jmbldwn commented 6 years ago

Cool. Will try this out.