创建了一个通用协议,以及一个解析了所有通用参数的专用协议。当尝试使用专用协议作为变量类型时,Xcode给出以下错误:Protocol 'MY_SPECIALIZED_PROTOCOL_NAME' can only be used as a generic constraintassociatedtype FetchEntity associatedtype Fe
如何在Swift中将协议作为参数传递?(id)locate:(id)objectType 在尝试使用以下方法进行Q字节回答之后:但我得到的“CurrentUserContex.Protocol”不能确认协议“AnyObject”ServiceLocator.locate(CurrentUserContex.self as!但我得到了:
Could not