Swift:Viewcontroller与协议UIGestureRecognizerDelegate的冗余一致性

时间:2015-09-12 15:22:06

标签: ios iphone swift swrevealviewcontroller

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

我读到了这个错误,但似乎令人困惑。

  

Viewcontroller与协议UIGestureRecognizerDelegate的冗余一致性

class Viewcontroller: SLKTextViewController,SWRevealViewControllerDelegate,UIGestureRecognizerDelegate {

    // a lot of functions and code

}

1 个答案:

答案 0 :(得分:11)

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

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

其他协议中已列出UIGestureRecognizerDelegate

解决方案:将代码更改为

,删除UIGestureRecognizerDelegate
class Viewcontroller : SLKTextViewController, SWRevealViewControllerDelegate {
相关问题