Overriding delegate property of UIScrollView in Swift (like UICollectionView does)

后端 未结 6 2094
春和景丽
春和景丽 2021-02-01 02:36

UIScrollView has a delegate property which conforms to UIScrollViewDelegate

protocol UIScrollViewDelegate : NSObjectProtocol {
    //...
}
class UIScrollView : U         


        
6条回答
  •  执念已碎
    2021-02-01 02:47

    You can override get and set method by declare function like:

    func setDelegate(delegate:UITableViewDelegate?){
         self.delegateInterceptor = delegate;
    }
    

    swift compiler the property to method as Objective-c does.

提交回复
热议问题