I have the following protocol:
protocol ViewCreator {
associatedtype ResultView: View
@ViewBuilder func createView() -> ResultView
}
and I want to get its type, for example to get its name. So I wrote the following code:
let typeName = String(describing: ViewCreator.self)
but got the following error:
Protocol 'ViewCreator' can only be used as a generic constraint because it has Self or associated type requirements.
In this case how can I get "self" of the protocol with the associated type?
P.S. I don't have an implementation of this protocol in scope.