I have an Objective-C variable that conforms to multiple protocols.
id identityToken;
How would I re
This should work:
var identityToken: NSObjectProtocol & NSCopying & NSCoding
Note you have to use NSObjectProtocol instead of NSObject in swift.
Here are some additional examples:
Array of objects conforming to multiple protocols:
var array: [NSObjectProtocol & NSCopying & NSCoding]
Function with a parameter that conforms to multiple protocols:
func foo(param: NSObjectProtocol & NSCopying & NSCoding) {
}
For Swift version before 3.1, use:
var identityToken: (NSObjectProtocol, NSCopying, NSCoding)