I have a structure:
struct ErrorResultType: ErrorType {
var description: String
var code: Int
}
and protocol:
protocol XProtocol {
func dealError(error: ErrorResultType)
}
Now I want to make a UIViewController extension:
extension UIViewController: XProtocol {
func dealError(error: ErrorResultType) {
}
}
So, I can subclass from this and override a function like:
class ABCViewController: UIViewController {
--->override func dealError(error: ErrorResultType) {
super.dealError(error)
}
}
But this does not happen like this: Declarations from extensions cannot be overridden yet
That makes no sense to me. When I replace everything ErrorResultTypewith AnyObject, the error will no longer be displayed.
What did I miss?
source
share