Latest 0.0.4
Homepage https://github.com/iossun/SMTimeLine1
License MIT
Platforms ios
Authors
使用CocoaPods
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]

Latest podspec

{
    "name": "SMTimeLine",
    "version": "0.0.4",
    "summary": "SMTimeLine.",
    "description": "SMTimeLineuff0cu65f6u95f4u56deu653eu6761uff0cu653eu5927u7f29u5c0fuff0cu6807u8bb0",
    "homepage": "https://github.com/iossun/SMTimeLine1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "sunmu": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/iossun/SMTimeLine1.git",
        "tag": "0.0.4"
    },
    "source_files": "SMTimeLine/Classes/*.{h,m}"
}

Pin It on Pinterest

Share This