Did you @objc when you announced your protocol?
I believe SomeProtocol.self is the right way to pass it, but since you are passing it to the obj-c API, it should have the @objc prefix, for example this example from the docs :
@objc protocol HasArea { var area: Double { get } }
Change It turns out that this protocol belongs to a library (written in objective-c, therefore already compatible with objective-c), not specified in Swift.
In this case, this is probably a compiler error, so before you do anything else , make sure you are using the latest version of Xcode (beta 3 at the time of writing).
If this does not work, I think Tommy's idea of ββusing NSProtocolFromString is the best problem until the compiler error is fixed.
source share