用于输入分钟或秒的iOS控件:DDHTimerControl

jopen 10年前

DDHTimerControl 是一个用来输入分钟数和秒数控件,是UIControl 子类。

用法

DDHTimerControl *timerControl = [DDHTimerControl timerControlWithType:DDHTimerTypeEqualElements];  timerControl.translatesAutoresizingMaskIntoConstraints = NO;  timerControl.color = [UIColor orangeColor];  timerControl.highlightColor = [UIColor redColor];  timerControl.minutesOrSeconds = 11;  timerControl.titleLabel.text = @"min";  timerControl.userInteractionEnabled = NO;  [contentView addSubview:timerControl];

目前,有支持的三种类型:

/**   *  Type of the timer ring   */  typedef NS_ENUM(NSUInteger, DDHTimerType) {      /**       *  The ring looks like a clock       */      DDHTimerTypeElements = 0,      /**       *  All the elements are equal       */      DDHTimerTypeEqualElements,      /**       *  The ring is a solid line       */      DDHTimerTypeSolid,      /**       *  The number of the different types       */      DDHTimerTypeNumberOfTypes  };



项目主页:http://www.open-open.com/lib/view/home/1404999524529