Initializer

init()

Creates an empty set.

Declaration 宣言

init()

Discussion 議論

This initializer is equivalent to initializing with an empty array literal. For example, you create an empty Set instance with either this initializer or with an empty array literal.


var emptySet = Set<Int>()
print(emptySet.isEmpty)
// Prints "true"


emptySet = []
print(emptySet.isEmpty)
// Prints "true"