Hello,
I wrote a gist to list all classes that subscribers a protocol:
https://gist.github.com/brunomacabeusbr/eea343bb9119b96eed3393e41dcda0c9
It work, but, I could not pass a protocol as parameter, then, I need wrote
one function each time I need to list class from different protocol.
I know how to pass a protocol using @obcj
<How passing a protocol as parameter in Swift - Stack Overflow, but I can't use @obcj,
because my protocols have property.
I found the solution. I need use a closure.
I updated the gist:
https://gist.github.com/brunomacabeusbr/eea343bb9119b96eed3393e41dcda0c9
ยทยทยท
2017-03-13 1:38 GMT-03:00 Bruno Macabeus <bruno.macabeus@gmail.com>:
Hello,
I wrote a gist to list all classes that subscribers a protocol:
https://gist.github.com/brunomacabeusbr/eea343bb9119b96eed3393e41dcda0c9
It work, but, I could not pass a protocol as parameter, then, I need wrote
one function each time I need to list class from different protocol.
I know how to pass a protocol using @obcj
<How passing a protocol as parameter in Swift - Stack Overflow, but I can't use @obcj,
because my protocols have property.
dafurman
(David Furman)
4
Hey Bruno, I'm trying to solve the same problem. Your gist leads to a 404 right now. Any chance you've still got it available?
macabeus
(Bruno Macabeus)
5
Wow, it's an ancient post.
I updated my GitHub username. Here's the new link: List all classes that subscribe a protocol ยท GitHub
Relevant xkcd
1 Like
Hey,
Wow, it's a very old gist.
I updated my GitHub username. Here's the new link: https://gist.github.com/macabeus/eea343bb9119b96eed3393e41dcda0c9
Doesn't that only work on platforms with the objc runtime?