One Logo Pool Ball
Foundation · IOS API REFERENCE

NSString.EnumerationOptions

struct · SDK 27.1

struct EnumerationOptions

Members (18)

get · iOS 14.0+

byCaretPositions

TypeScript
get byCaretPositions(): NSString_EnumerationOptions
Swift declaration
static var byCaretPositions: NSString.EnumerationOptions { get }
get

byComposedCharacterSequences

TypeScript
get byComposedCharacterSequences(): NSString_EnumerationOptions
Swift declaration
static var byComposedCharacterSequences: NSString.EnumerationOptions { get }
get · iOS 14.0+

byDeletionClusters

TypeScript
get byDeletionClusters(): NSString_EnumerationOptions
Swift declaration
static var byDeletionClusters: NSString.EnumerationOptions { get }
get

byLines

TypeScript
get byLines(): NSString_EnumerationOptions
Swift declaration
static var byLines: NSString.EnumerationOptions { get }
get

byParagraphs

TypeScript
get byParagraphs(): NSString_EnumerationOptions
Swift declaration
static var byParagraphs: NSString.EnumerationOptions { get }
get

bySentences

TypeScript
get bySentences(): NSString_EnumerationOptions
Swift declaration
static var bySentences: NSString.EnumerationOptions { get }
get

byWords

TypeScript
get byWords(): NSString_EnumerationOptions
Swift declaration
static var byWords: NSString.EnumerationOptions { get }
get

localized

TypeScript
get localized(): NSString_EnumerationOptions
Swift declaration
static var localized: NSString.EnumerationOptions { get }
get

reverse

TypeScript
get reverse(): NSString_EnumerationOptions
Swift declaration
static var reverse: NSString.EnumerationOptions { get }
get

substringNotRequired

TypeScript
get substringNotRequired(): NSString_EnumerationOptions
Swift declaration
static var substringNotRequired: NSString.EnumerationOptions { get }
method

formIntersection

TypeScript
formIntersection($self: NSString_EnumerationOptions, other: NSString_EnumerationOptions): void
Swift declaration
mutating func formIntersection(_ other: String.EnumerationOptions)

Removes the elements of this set that aren't also in the given set. In the following example, the elements of the `employees` set that are not also members of the `neighbors` set are removed. In particular, the names `"Alicia"`, `"Chris"`, and `"Diana"` are removed. var employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"] let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"] employees.formIntersection(neighbors) print(employees) // Prints "["Bethany", "Eric"]" - Parameter other: A set of the same type as the current set.

method

formSymmetricDifference

TypeScript
formSymmetricDifference($self: NSString_EnumerationOptions, other: NSString_EnumerationOptions): void
Swift declaration
mutating func formSymmetricDifference(_ other: String.EnumerationOptions)

Removes the elements of the set that are also in the given set and adds the members of the given set that are not already in the set. In the following example, the elements of the `employees` set that are also members of `neighbors` are removed from `employees`, while the elements of `neighbors` that are not members of `employees` are added to `employees`. In particular, the names `"Bethany"` and `"Eric"` are removed from `employees` while the name `"Forlani"` is added. var employees: Set = ["Alicia", "Bethany", "Diana", "Eric"] let neighbors: Set = ["Bethany", "Eric", "Forlani"] employees.formSymmetricDifference(neighbors) print(employees) // Prints "["Diana", "Forlani", "Alicia"]" - Parameter other: A set of the same type.

method

insert

TypeScript
insert($self: NSString_EnumerationOptions, newMember: NSString_EnumerationOptions): { "inserted": boolean; "memberAfterInsert": NSString_EnumerationOptions }
Swift declaration
@discardableResult mutating func insert(_ newMember: String.EnumerationOptions) -> (inserted: Bool, memberAfterInsert: String.EnumerationOptions)

Inserts the given element in the set if it is not already present. If an element equal to `newMember` is already contained in the set, this method has no effect. In this example, a new element is inserted into `classDays`, a set of days of the week. When an existing element is inserted, the `classDays` set does not change. enum DayOfTheWeek: Int { case sunday, monday, tuesday, wednesday, thursday, friday, saturday } var classDays: Set<DayOfTheWeek> = [.wednesday, .friday] print(classDays.insert(.monday)) // Prints "(true, .monday)" print(classDays) // Prints "[.friday, .wednesday, .monday]" print(classDays.insert(.friday)) // Prints "(false, .friday)" print(classDays) // Prints "[.friday, .wednesday, .monday]" - Parameter newMember: An element to insert into the set. - Returns: `(true, newMember)` if `newMember` was not contained in the set. If an element equal to `newMember` was already contained in the set, the method returns `(false, oldMember)`, where `oldMember` is the element that was equal to `newMember`. In some cases, `oldMember` may be distinguishable from `newMember` by identity comparison or some other means.

method

remove

TypeScript
remove($self: NSString_EnumerationOptions, member: NSString_EnumerationOptions): (NSString_EnumerationOptions) | null
Swift declaration
@discardableResult mutating func remove(_ member: String.EnumerationOptions) -> String.EnumerationOptions?

Removes the given element and any elements subsumed by the given element. - Parameter member: The element of the set to remove. - Returns: For ordinary sets, an element equal to `member` if `member` is contained in the set; otherwise, `nil`. In some cases, a returned element may be distinguishable from `member` by identity comparison or some other means. For sets where the set type and element type are the same, like `OptionSet` types, this method returns any intersection between the set and `[member]`, or `nil` if the intersection is empty.

method

contains

TypeScript
contains($self: NSString_EnumerationOptions, member: NSString_EnumerationOptions): boolean
Swift declaration
func contains(_ member: String.EnumerationOptions) -> Bool

Returns a Boolean value that indicates whether the given element exists in the set. This example uses the `contains(_:)` method to test whether an integer is a member of a set of prime numbers. let primes: Set = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37] let x = 5 if primes.contains(x) { print("\(x) is prime!") } else { print("\(x). Not prime.") } // Prints "5 is prime!" - Parameter member: An element to look for in the set. - Returns: `true` if `member` exists in the set; otherwise, `false`.

method

isSubset

TypeScript
isSubset($self: NSString_EnumerationOptions, other: NSString_EnumerationOptions): boolean
Swift declaration
func isSubset(of other: String.EnumerationOptions) -> Bool

Returns a Boolean value that indicates whether the set is a subset of another set. Set *A* is a subset of another set *B* if every member of *A* is also a member of *B*. let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"] let attendees: Set = ["Alicia", "Bethany", "Diana"] print(attendees.isSubset(of: employees)) // Prints "true" - Parameter other: A set of the same type as the current set. - Returns: `true` if the set is a subset of `other`; otherwise, `false`.

method

formUnion

TypeScript
formUnion($self: NSString_EnumerationOptions, other: NSString_EnumerationOptions): void
Swift declaration
mutating func formUnion(_ other: String.EnumerationOptions)

Adds the elements of the given set to the set. In the following example, the elements of the `visitors` set are added to the `attendees` set: var attendees: Set = ["Alicia", "Bethany", "Diana"] let visitors: Set = ["Diana", "Marcia", "Nathaniel"] attendees.formUnion(visitors) print(attendees) // Prints "["Diana", "Nathaniel", "Bethany", "Alicia", "Marcia"]" If the set already contains one or more elements that are also in `other`, the existing members are kept. var initialIndices = Set(0..<5) initialIndices.formUnion([2, 3, 6, 7]) print(initialIndices) // Prints "[2, 4, 6, 7, 0, 1, 3]" - Parameter other: A set of the same type as the current set.

init

init

TypeScript
init(rawValue: number): NSString_EnumerationOptions
Swift declaration
init(rawValue: UInt)

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSString.EnumerationOptions.init(_:)

This parameter hides a concrete Swift type.

All Foundation types →