WeakSet

public struct WeakSet<Element: AnyObject>

Holds a set of objects of a specific type, where each object is weakly-referenced.

Note

This object should not be used in code that requires high performance (e.g. in render operations), as it is slow.
  • all

    An array representation of all objects in this set.

    Declaration

    Swift

    public var all: [Element]
  • Adds an object to the set.

    Declaration

    Swift

    public mutating func add(_ object: Element)
  • Removes an object from the set.

    Declaration

    Swift

    public mutating func remove(_ object: Element)
  • Removes all objects from the set.

    Declaration

    Swift

    public mutating func removeAll()
  • Declaration

    Swift

    public func makeIterator() -> Iterator