Example:
list.insert(element, at: index)
instead of
list.insert(element, position: index)
Example:
factory.makeObject()
Example:
factory.makeObject(key: value)
Instead of:
factory.makeObject(havingProperty: value)
form-
.-ing
or -ed
.
print(value)
array.sort() // in place sorting
list.add(value) // mutates list
set.formUnion(anotherSet) // set is now the union of set and anotherSet
Nonmutating functions:
let sortedArray = array.sorted() // out of place sorting
let union = set.union(anotherSet) // union is now the union of set and another set
Example:
set.isEmpty
line.intersects(anotherLine)
-able
, -ible
or -ing
as suffix.Collection // describes that something is a collection
ProgressReporting // describes that something has the capability of reporting progress
Equatable // describes that something has the capability of being equal to something
Example:
let factory = ...
let list = [1, 2, 3, 4]