Returns a Boolean value that indicates whether at least one object in the receiving set is also present in another given set.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
func intersects(_ otherSet: Set<Any Hashable>) -> Bool
Parameters
otherSet
The set with which to compare the receiving set.
Return Value
true
if at least one object in the receiving set is also present in other
, otherwise false
.
Discussion
Object equality is tested using isEqual:.