-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGCDTimer.h
More file actions
41 lines (36 loc) · 798 Bytes
/
GCDTimer.h
File metadata and controls
41 lines (36 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// GCDTimer.h
// Face_meal
//
// Created by funny on 2017/12/20.
// Copyright © 2017年 fu. All rights reserved.
// GCD计时器封装
#import <Foundation/Foundation.h>
typedef void (^task)();
typedef NS_ENUM(NSUInteger,GCDTimerStatues) {
GCDTimerNeedResume,
GCDTimerWorking,
GCDTimerSuspend,
};
@interface GCDTimer : NSObject
@property (nonatomic, assign)GCDTimerStatues statues;
/**
init
@param sec 延迟多少s执行
@param padding_sec 间隔多少秒
@param task 要执行的任务
@return instancetype id
*/
- (instancetype)initWithStartAfter:(CGFloat)sec
padding:(CGFloat)padding_sec
task:(task)task;
/**
启动或恢复启动
*/
- (void)resume;
/**
挂起
*/
- (void)suspend;
- (void)cancle;
@end