标尺升级版 (scrollRulerView upgrade)
CYRuler *ruler = [CYRuler horizontalUpRulerWithFrame:CGRectMake(10, 300, 300, 80)];
[self.view addSubview:ruler];
ruler.rulerDelegate = self;
[ruler rulerWithPointerOffset:100.0f startScale:10 endScale:1000 valueOfUnitScale:10 defaultScale:20];
CYRuler *ruler = [CYRuler horizontalDownRulerWithFrame:CGRectMake(10, 100, 300, 80)];
[self.view addSubview:ruler];
ruler.rulerDelegate = self;
[ruler rulerWithPointerOffset:100.0f startScale:10 endScale:1000 valueOfUnitScale:10 defaultScale:20];
ruler.scaleNumberFont = [UIFont systemFontOfSize:8];
ruler.scaleNumberColor = [UIColor whiteColor];
ruler.scaleLineColor = [UIColor whiteColor];
ruler.scaleLineWidth = 0.5;
[ruler rulerResetPointerOffset:150 startScale:30 endScale:1000 valueOfUnitScale:10 defaultScale:50];
UIView *pointer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
pointer.backgroundColor = [UIColor whiteColor];
ruler.pointer = pointer; //can not be nil
UILabel *scaleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
scaleLable.backgroundColor = [UIColor blueColor];
scaleLable.textAlignment = NSTextAlignmentCenter;
ruler.scaleLable = scaleLable; //can be nil
pod 'CYRuler'
#import