Hi all,
I just got CocoaAsyncSocket and I'm having an issue using it in Swift. I have a class that uses the protocol 'GCDAsyncUdpSocketDelgate'. To conform to the protocol I have to implement the self function, but it gives me an error. Here's part of the code:
class Incoming: GCDAsyncUdpSocketDelegate {
@objc func `self`() -> Self {
return self
}
}
The error on the function says two things, "
Method cannot be marked @objc because its result type cannot be represented in Objective-C", and "Non-'@objc' method 'self()' does not satisfy requirement of '@objc' protocol 'NSObjectProtocol'".
I have tried putting the protocol in an extension, but got the same error. I also tried removing the '@objc', but that didn't help either. Any ideas?
Thanks,
GW