5
Протокол может использоваться только как общее ограничение, потому что он имеет требования Self или associatedType.
У меня есть протокол RequestType, и у него есть модель AssociatedType, как показано ниже. public protocol RequestType: class { associatedtype Model var path: String { get set } } public extension RequestType { public func executeRequest(completionHandler: Result<Model, NSError> -> Void) { request.response(rootKeyPath: rootKeyPath) { [weak self] (response: Response<Model, NSError>) -> …