I'm having trouble getting the fast class to conform to the objective protocol c. It is easy to implement methods in an objective c-protocol in swift, but I cannot implement properties in the following protocol.
Protocol
@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 made this quick class that should match it, but Xcode says it is not.
class ConversationParticipant: NSObject, ATLParticipant { var firstName: NSString? var lastName: NSString? var fullName: NSString? var participantIdentifier: NSString? override init() { super.init() } }
I tried to make member variables optional (as mentioned above) and unpacked and prefixed with private (set) to make them readonly, but none of these options work.
source share