如何自定义iOS中的控件

How to build a custom control in iOS

跟踪用户触控,要重写以下方法。

- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)event;

- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(nullable UIEvent *)event;

- (void)endTrackingWithTouch:(nullable UITouch *)touch withEvent:(nullable UIEvent *)event; 

- (void)cancelTrackingWithEvent:(nullable UIEvent *)event;

你可能感兴趣的:(如何自定义iOS中的控件)