Generic Initializer

init(_:)

Creates a new set from a finite sequence of items.

Declaration

init<S>(_ sequence: S) where S : Sequence, Self.Element == S.Element

Parameters

sequence

The elements to use as members of the new set.

Discussion

Use this initializer to create a new set from an existing sequence, like an array or a range:

let validIndices = Set(0..<7).subtracting([2, 4, 5])
print(validIndices)
// Prints "[6, 0, 1, 3]"

See Also

Creating Augmentation Options

init()

Creates an empty option set.

init(arrayLiteral: MLImageClassifier.ImageAugmentationOptions...)

Creates a set containing the elements of the given array literal.

init(rawValue: Int)

Creates an augmentation set with the given raw value.

let rawValue: Int

The underlying integer of the augmentation option.