Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies Swift API Design Guidelines to name, label, and document Swift APIs, covering argument labels and call-site clarity.
87% 96%+9 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 20 of 23 without it.
I am writing a Swift view container type. I need a method signature to add a subview parameter of type `UIView`. Developers might write `func add(subview: UIView)`. What parameter label and method name structure should be used for call-site clarity?
The method base name incorporates the word Subview or subview.
3 of 3 safety checks passed
Extended examples for argument label rules, edge cases, parameter naming, and default argument strategy.
The base rule: when the first argument completes a prepositional phrase with the base name, use the preposition as the argument label.
// Standard cases — preposition is the label
x.removeBoxes(havingLength: 12)
view.fade(from: red)
path.relativePath(from: root)
When the first two arguments represent parts of a single abstraction, fold the preposition into the base name so each component gets its own label.
// GOOD — x and y are parts of a single abstraction (a point)
a.moveTo(x: b, y: c)
// BAD — forces x and y into a single prepositional phrase
a.move(toX: b, y: c)
// GOOD — row and column are parts of a single abstraction (a cell position)
table.cellAt(row: r, column: c)
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.