ios - swift : Redundant conformance of Viewcontroller to protocol UIGestureRecognizerDelegate

标签 ios iphone swift swrevealviewcontroller

我想添加两个框架 SWRevealViewControllerSLKTextViewController 但我收到了这个奇怪的错误。

我读到了这个错误,但它看起来很困惑。

Redundant conformance of Viewcontroller to protocol UIGestureRecognizerDelegate

class Viewcontroller: SLKTextViewController,SWRevealViewControllerDelegate,UIGestureRecognizerDelegate {

    // a lot of functions and code

}

最佳答案

错误的原因是您尝试两次符合UIGestureRecognizerDelegate。一次明确地在开始和第二次通过扩展已经符合它的 SLKTextViewController 编写它 - the source code of SLKTextViewController由以下行组成:

NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController <UITextViewDelegate, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UIGestureRecognizerDelegate, UIAlertViewDelegate>

在其他协议(protocol)中,它已经列出了 UIGestureRecognizerDelegate!

解决方案:通过将代码更改为

来移除UIGestureRecognizerDelegate
class Viewcontroller : SLKTextViewController, SWRevealViewControllerDelegate {

关于ios - swift : Redundant conformance of Viewcontroller to protocol UIGestureRecognizerDelegate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32540452/

相关文章:

ios - 如何在 ios 中的 instagram 上分享?

ios - 如何将 UIview 添加到 imageView,同时确保 UIView 的内容位于其框架内?

javascript - 用html5视频提取部分视频。 iphone/ipad 上的全屏问题

iphone - iPhone Objective-C 中的补间值

iphone - ios5中如何使用identifierForVendor?

ios - 使用 tableviewcontroller 时对导航栏的模糊效果

ios - 为什么不将值添加到 NSMutableArray?

ios - iOS 沙盒 Game Center 排行榜是否会转移到真正的 Game Center?

iphone - 如何使用 iPhone 相机实时翻译图像的文本?

swift - 本地化和自动布局