1
我对Swift非常陌生,试图创建天气应用程序。我有协议func weatherManagerFailedToLoadCityWithError(error: ErrorType)
。在weatherManager.swift有一些代表天气应用程序中的ErrorType协议
} else if status == 404 {
// City not found
if self.delegate != nil {
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.delegate?.weatherManagerFailerToLoadCityWithError(.InvalidResponse)
})
}
} else {
// Some other here?
if self.delegate != nil {
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.delegate?.weatherManagerFailerToLoadCityWithError(.MissingData)
})
}
}
我应该做我在这个代码块
func weatherManagerFailedToLoadCityWithError(error: ErrorType) {
}
任何建议weatherController.swift什么?