iOS Swift 中的 OneDrive SDK:LiveOperationDelegate 和 LiveDownloadOperationDelegate 协议之间存在冲突

OneDrive SDK in iOS Swift: Conflict between LiveOperationDelegate and LiveDownloadOperationDelegate protocols

我在 Swift 应用程序中集成了 OneDrive SDK,但是当我符合两个协议 LiveOperationDelegate and LiveDownloadOperationDelegate 并且我想实现它们时:

func liveOperationSucceeded(operation: LiveOperation!) {}
func liveOperationFailed(error: NSError!, operation: LiveOperation!) {}
func liveOperationSucceeded(operation: LiveDownloadOperation!) {}
func liveOperationFailed(error: NSError!, operation: LiveDownloadOperation!) {}

我收到此错误消息: Method 'liveOperationSucceeded' with Objective-C selector 'liveOperationSucceeded:' conflicts with previous declaration with the same Objective-C selector

如何解决?

我所做的事情是我创建了一个新的 Class,它继承自 LiveDownloadOperationDelegate。然后你只需要在调用 downloadFromPath 函数时将你的实例作为委托传递,你就可以在你的新 class.

中处理回调

我希望这个回答能解决你的问题。