Instance Method

update(with:)

Inserts the given element into the set.

Declaration

@discardableResult mutating func update(with newMember: ARView.EntityGestures) -> ARView.EntityGestures?

Return Value

The intersection of [newMember] and the set if the intersection was nonempty; otherwise, nil.

Discussion

If newMember is not contained in the set but subsumes current members of the set, the subsumed members are returned.

var options: ShippingOptions = [.secondDay, .priority]
let replaced = options.update(with: .express)
print(replaced == .secondDay)
// Prints "true"

See Also

Adding and Removing Options

func insert(ARView.EntityGestures) -> (inserted: Bool, memberAfterInsert: ARView.EntityGestures)

Adds the given element to the option set if it is not already a member.

func remove(ARView.EntityGestures) -> ARView.EntityGestures?

Removes the given element and all elements subsumed by it.

func subtract(ARView.EntityGestures)

Removes the elements of the given set from this set.

func subtracting(ARView.EntityGestures) -> ARView.EntityGestures

Returns a new set containing the elements of this set that do not occur in the given set.