I am having trouble making a swift class conform to an objective c protocol. It is easy to implement the methods in an objective c protocol in swift, but I can't implement the properties in the following protocol.
The protocol is
@protocol ATLParticipant <NSObject>
@property (nonatomic, readonly) NSString *firstName;
@property (nonatomic, readonly) NSString *lastName;
@property (nonatomic, readonly) NSString *fullName;
@property (nonatomic, readonly) NSString *participantIdentifier;
@end
I have made this swift class which should conform to it, but Xcode says it doesn't.
class ConversationParticipant: NSObject, ATLParticipant {
var firstName: NSString?
var lastName: NSString?
var fullName: NSString?
var participantIdentifier: NSString?
override init() {
super.init()
}
}
I have tried making the member variables optional (as above), and unwrapped, and prefixed with private(set) to make them readonly, but none of these variations work.