Unable to use custom class in a protocol with @objc attribute?
问题 I am trying to create a protocol for JSON loading delegation, JSONLoaderDelegate . My other class, called JSONLoader , is supposed to dispatch events to its delegate (that implements the JSONLoaderDelegate protocol) like: self?.delegate?.jsonLoaderdidEndWithError(self!, error: JSONLoaderError.LoadError) The implementation of the JSONLoader is not that important (imho). However I seem to have problems to implement the protocol, this is the code: @objc protocol JSONLoaderDelegate { optional