Initializerswift 6.0.1Swift

    init(_:within:)

    Creates a new range set containing ranges that contain only the specified indices in the given collection.

    iOS
    18.0+
    macOS
    15.0+
    tvOS
    18.0+
    visionOS
    2.0+
    watchOS
    11.0+
    init<S, C>(_ indices: S, within collection: C) where Bound == S.Element, S : Sequence, C : Collection, S.Element == C.Index

    Parameters

    index

    The index to include in the range set. index must be a valid index of collection that isn’t the collection’s endIndex.

    collection

    The collection that contains index.

    Other members in extension

    Types

    • struct Ranges

      A collection of the ranges that make up a range set.

    Type members

    Instance members