Reputation: 1829
Lets say I have protocol:
protocol FooProtocol{
func bar<Request: Codable, Response: Codable>()
}
And I have class:
class Foo: FooProtocol { //Xcode complains here about protocol conformance with a fix button
}
if I tap on the Xcode autocomplete to fix the protocol conformance, the following function is generated:
class Foo: FooProtocol {
func bar<Request, Response>() where Request : Decodable, Request : Encodable, Response : Decodable, Response : Encodable {
}
}
Not very pretty. I have to manually rewrite the function:
func bar<Request: Codable, Response: Codable>()
is there a way to change this behaviour in Xcode?
Upvotes: 1
Views: 30
Reputation:
No. And all of the standard library is formatted in that heinous way too.
struct Dictionary<Key, Value> where Key : Hashable {
https://developer.apple.com/documentation/combine/publishers/combinelatest4
https://developer.apple.com/documentation/swift/int/2884879-init
Upvotes: 1