What is equivalent of setByAddingObject:
in Swift. I have an NSSet
property from Objective-C in Swift. But since Apple released Xcode 6.3 I have an error in this place:
Example:
NSSet *set;
object.set = object.set.setByAddingObject("text/html")
It produces error:
'Set<NSObject>' does not have a member named 'setByAddingObject'
Any idea, how to fix this? insert
method doesn't work also.
Swift 1.2 added its own Set
type, which is bridged over to Swift from Objective-C in a similar fashion to NSArray
/Array
and NSString
/String
. Try object.set.insert("text/html")
.