Hi there, I'm implementing a protocol that has multiple parents, and I'm unsure of the most preferred way to line-wrap the parents, and where to put the open curly brace. I want the protocol style to stay consistent with how I declare my functions too.
This is how I declare my functions, but this style looks weird for declaring protocols with multiple parents:
func doSomething(
foo: String,
bar: String,
baz: String
) {
...
}
For protocols, here are a few of what my declarations could look like. Any suggestions on which is common and more preferred?
(A)
protocol MyProtocol:
ParentA,
ParentB,
ParentC,
ParentD {
let name: String
}
(B)
protocol MyProtocol:
ParentA,
ParentB,
ParentC,
ParentD
{
let name: String
}
(C) (the alignment got weird, but all the parents are supposed to be aligned here)
protocol MyProtocol: ParentA,
ParentB,
ParentC,
ParentD {
let name: String
}
(D) (the alignment got weird, but all the parents are supposed to be aligned here)
protocol MyProtocol: ParentA,
ParentB,
ParentC,
ParentD
{
let name: String
}