Ich bin neu in der heutigen Erweiterung, ich habe diese Warnung, weiß jemand, wie die optionale Anforderung entsprechen?Instanzmethode 'widgetPerformUpdate (completionHandler :)' fast entspricht optionale Anforderung 'widgetPerformUpdate (completionHandler :)'
Instanz Methode 'widgetPerformUpdate (completionHandler :)' beinahe entspricht optional Anforderung 'widgetPerformUpdate (completionHandler :)' des Protokolls 'NCWidgetProviding'
func widgetPerformUpdate(completionHandler: ((NCUpdateResult) -> Void)) {
// Perform any setup necessary in order to update the view.
// If an error is encountered, use NCUpdateResult.Failed
// If there's no update required, use NCUpdateResult.NoData
// If there's an update, use NCUpdateResult.NewData
let result = performFetch()
if result == .newData{
tableView.reloadData()
self.preferredContentSize = tableView.contentSize
}
completionHandler(result)
}
Probieren Sie 'func widgetPerformUpdate (completionHandler: @ escaping (NCUpdateResult) -> Void) {' – rmaddy
@rmaddy, es funktioniert! –