
Swift是不允许设置协议的可选的状态,协议声明的方法都是必须实现的。
解决方案一

解决方案二
实现所有声明的方法
我的做法
在父类中实现声明的方法
class HLBaseViewController: UIViewController, UIViewCollectEventsDelegate
func uiView(ClickRefreshWithParams params: AnyObject?) {
}
func uiView(uiView: UIView?, CollectEventsType type: AnyObject?, withParams params: AnyObject?) {
}
在子类中替换掉要实现的方法
class HomeViewController: HLBaseViewController
override func uiView(uiView: UIView?, CollectEventsType type: AnyObject?, withParams params: AnyObject?) {
NSLog("789")
}