UIGestureRecognizerDelegate

UIGestureRecognizerDelegate

我想添加两个框架SWRevealViewControllerSLKTextViewController,但是出现这个奇怪的错误。

我读到有关此错误的消息,但似乎令人困惑。


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/

10-09 19:43