ios - 导入外部库后,具有 UINavigationControllerDelegate 的 ViewController 中出现冗余一致性错误

标签 ios objective-c swift uiviewcontroller uinavigationcontroller

我手动将这个库导入到我的项目文件夹中

https://github.com/y-hryk/YSLTransitionAnimator

但问题是,一旦我将这个库导入到我的桥接 header 中

#import "YSLTransitionAnimator.h"
#import "UIViewController+YSLTransition.h"

我收到编译错误信息

/Users/jay/ios/TestProject/TestProject/ProfilePictureSetupViewController.swift:11:60: Redundant conformance of 'ProfilePictureSetupViewController' to protocol 'UINavigationControllerDelegate'

我知道这个 #import "UIViewController+YSLTransition.h" 是导致错误的原因,但我不知道为什么

有什么想法吗?

最佳答案

因为 UIViewController 类已使用 YSLTransition 进行了扩展。它也已经符合 UINavigationControllerDelegate。因此,您无需在 ProfilePictureSetupViewController View Controller 中再次符合 UINavigationControllerDelegate(删除它将修复错误)

关于ios - 导入外部库后,具有 UINavigationControllerDelegate 的 ViewController 中出现冗余一致性错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33646501/

相关文章:

ios - 如何使用 Swift 以编程方式在 iOS 中显示弹出窗口?

ios - 以编程方式创建并添加到 uiimageview 时,UIButton 无响应

objective-c - 无法识别的选择器发送到实例,原因

objective-c - 当 NSString 的长度减少时,内存会被释放吗?还是我必须做更多的事情?

arrays - Swift Array.contains() 不调用 PFUser 子类的 Equatable 函数

iphone - 应用程序由于 CLLocationManager 挂起(主线程被阻塞?)

objective-c - 从状态栏取消隐藏并激活应用程序时,窗口按钮呈灰色

ios - 将纯字符串转换为 JSON 并在 Swift 中返回

iOS 无法删除通知观察器。 Deinit 没有被调用

ios - 如何从 Apple Watch 触发与后端的通信?