A set of the same type as the current set. 現在の集合と同じ型の集合。
Instance Method
インスタンスメソッド
form
formIntersection(_:)
Removes the elements of this set that aren’t also in the given set.
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- macOS 12.0+
- Mac Catalyst 15.0+
- tvOS 15.0+
- watchOS 8.0+
Technology
- Swift
UI
Declaration 宣言
mutating func formIntersection(_ other: AccessibilityTechnologies
)
Parameters パラメータ
other
Discussion 議論
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"]"