Xaxxus
Xaxxus

Reputation: 1829

Is there a way to change Xcode's behaviour of protocol conformance autocompletion

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

Answers (1)

user652038
user652038

Reputation:

No. And all of the standard library is formatted in that heinous way too.

struct Dictionary<Key, Value> where Key : Hashable {

Upvotes: 1

Related Questions