Swift API Design Guide says:
The first argument to initializer and factory methods calls should not form a phrase starting with the base name
Specially, it advises us against writing things like:
let foreground = Color(havingRGBValuesRed: 32, green: 64, andBlue: 128)
let newPart = factory.makeWidget(havingGearCount: 42, andSpindleCount: 14)
let ref = Link(to: destination)
But in the Swift Standard Library or UIKit we find code like:
struc Array<T> {
// ...
init(repeating repeatedValue: Array.Element, count: Int)
}
class UIImage {
// ...
init?(
named name: String,
in bundle: Bundle?,
compatibleWith traitCollection: UITraitCollection?
)
}
Is it correct?