TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2017 |
Maintained by sunmu.
pod "SMTimeLine"
将Classes文件夹中的所有源代码拽入项目中
导入主头文件:#import "SMTimeLineView.h"
self.timeLine = [[SMTimeLineView alloc] initWithFrame:CGRectMake(0, 300,kWinW,200)];
_timeLine.delegate = self;
[self.view addSubview:_timeLine];
#pragma mark --- MNTimeLineTimeDelegate
-(void)timeLinePresentTime:(NSDate *)time{
NSTimeInterval cha = [time timeIntervalSinceDate:[NSDate date]];
NSLog(@"%@ 时间差%d",time,(int)cha);
}
[_timeLine setTimeLineWithDate:[NSDate date]];
-(void)addRect{
int x = arc4random() % 23;
NSDate *start = [NSDate dateWithTimeIntervalSinceNow:-x * 3600 - 24 * 3600];
NSDate *stop = [NSDate dateWithTimeInterval:23 * 60 * 60 sinceDate:start];
[_timeLine joinDrawTimeLineRectWithStart:start stop:stop];
[_timeLine updateTimeline];
}
[_timeLine.updateView startUpdateAnimation];
[_timeLine.updateView stopUpdateAnimation];
如有问题:[email protected]