[swift-users] How to pass a protocol as parameter, without using @objc?

Bruno Macabeus bruno.macabeus at gmail.com
Tue Mar 14 01:15:01 CDT 2017


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 at 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
> <http://stackoverflow.com/a/27162499/3440266>, but I can't use @obcj,
> because my protocols have property.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170314/c45f1e06/attachment.html>


More information about the swift-users mailing list