Contents

isEmpty

A Boolean value that indicates whether the dictionary is empty.

Declaration

var isEmpty: Bool { get }

Discussion

Dictionaries are empty when created with an initializer or an empty dictionary literal.

var frequencies: [String: Int] = [:]
print(frequencies.isEmpty)
// Prints "true"

See Also

Inspecting a Dictionary