我正在编写具有关联类型的协议:
IQKeyboardManager.sharedManager().enable = true
IQKeyboardManager.sharedManager().enableAutoToolbar = false
IQKeyboardManager.sharedManager().shouldShowToolbarPlaceholder = false
IQKeyboardManager.sharedManager().shouldResignOnTouchOutside = true
问题是我无法创建var委托:SliderViewDelegate? 它给我错误提示:
protocol SliderViewDelegate: class {
associatedtype Item
var anyProperty: Item { get set }
func ytmSliderView(sliderView: YTMSliderView<Item>, didSelectItemAt index: Int, withView: UIView) //sliderItemTappedAnIndex
func ytmSliderView(sliderItemURLat section: Int, item: Int) -> String?
}
如何解决这个问题?