Questions tagged [protocol-op]

2 questions
5
votes
2 answers

Swift protocol with associated type - type may not reference itself as a requirement

I have the following protocol and its extension public protocol RESEndpointReachable: CustomDebugStringConvertible { associatedtype EndpointType: RESEndpointReachable // MARK: - Properties /// The name of the endpoint as defined in…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

Should my API be a Class, Struct, or Protocol?

It is an abstract API upon which more domain specific APIs are based for querying URLs. Should the abstract version (which contains the networking functions, and the data structure) be written as a Class, Struct, or Protocol?
Brandon Bradley
  • 3,160
  • 4
  • 22
  • 39