Swift API Design Guide - Initializer and factory methods calls

Swift API Design Guide (https://swift.org/documentation/api-design-guidelines) 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 UIKit or in Foundation, 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 ?

Correct according to swift.org, or apple? I'd side w/apple when working with their SDKs.


Seen this discussion from Erica?

h ttp://ericasadun.com/2016/02/09/the-trouble-with-argument-labels-some-thoughts/

Swift API Design Guide - Initializer and factory methods calls
 
 
Q