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什麼?