该项目是使用 PSAnalogClockView
的快速示例,它是一个允许您通过提供自己的图像来创建模拟风格时钟的类。
该类可接受以下图像:
类可以以两种不同的方式实例化:
通过实例化类并添加图像
PSAnalogClockView *analogClock = [[PSAnalogClockView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
analogClock.hourHandImage = [UIImage imageNamed:@"clock_hour_hand"];
analogClock.minuteHandImage = [UIImage imageNamed:@"clock_minute_hand"];
analogClock.secondHandImage = [UIImage imageNamed:@"clock_second_hand"];
analogClock.centerCapImage = [UIImage imageNamed:@"clock_centre_point"];
[self.view addSubview:analogClock];
[analogClock start];
通过传递图像的 NSDictionary
实例化类
PSAnalogClockView *analogClock3 = [[PSAnalogClockView alloc] initWithFrame:CGRectMake(220, 246, 80, 80)
andImages:[self images]];;
[self.view addSubview:analogClock3];
[analogClock3 start];