Overriding delegate property of UIScrollView in Swift (like UICollectionView does)
问题 UIScrollView has a delegate property which conforms to UIScrollViewDelegate protocol UIScrollViewDelegate : NSObjectProtocol { //... } class UIScrollView : UIView, NSCoding { unowned(unsafe) var delegate: UIScrollViewDelegate? //... } UICollectionView overrides this property with a different type UICollectionViewDelegate protocol UICollectionViewDelegate : UIScrollViewDelegate, NSObjectProtocol { //... } class UICollectionView : UIScrollView { unowned(unsafe) var delegate: