Return Value 戻り値
A new set. 新しい集合。
Availability 有効性
Technology
func intersection(_ other: AccessibilityTechnologies
) -> AccessibilityTechnologies
A new set. 新しい集合。
other
A set of the same type as the current set. 現在の集合と同じ型の集合。
In the following example, the both
set is made up of the elements that are in both the employees
and neighbors
sets. Elements that are in only one or the other are left out of the result of the intersection.
let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"]
let bothNeighborsAndEmployees = employees.intersection(neighbors)
print(bothNeighborsAndEmployees)
// Prints "["Bethany", "Eric"]"
Note 注意
if this set and other
contain elements that are equal but distinguishable (e.g. via ===
), which of these elements is present in the result is unspecified.