Initializer

init()

Creates an empty set.

Required. Default implementation provided.

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"

Default Implementations

OptionSet Implementations

init()

Creates an empty option set.