A set of the same type. 同じ型の集合。
Instance Method
インスタンスメソッド
form
formSymmetricDifference(_:)
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.
Availability 有効性
- iOS 13.0+
- iPadOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
Technology
- Swift
UI
Declaration 宣言
mutating func formSymmetricDifference(_ other: AccessibilityTraits
)
Parameters パラメータ
other
Discussion 議論
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"]"