How to correctly subclass UIControl?

后端 未结 7 688
北海茫月
北海茫月 2020-12-04 09:26

I don\'t want UIButton or anything like that. I want to subclass UIControl directly and make my own, very special control.

But for some rea

7条回答
  •  余生分开走
    2020-12-04 09:43

    Obj C

    I found a related article from 2014 https://www.objc.io/issues/13-architecture/behaviors/.

    The interesting thing about it is that its approach is to make use of IB and encapsulate the event handling logic inside a designated object (they call it behaviors), thus removing logic from your view/viewController making it lighter.

    • Github sample case: https://github.com/krzysztofzablocki/BehavioursExample

提交回复
热议问题