BUTimer.h 921 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // BUTimer.h
  3. // BUAdSDK
  4. //
  5. // Created by 李盛 on 2018/6/20.
  6. // Copyright © 2018年 bytedance. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface BUTimer : NSObject
  11. @property (nonatomic, copy) NSString *runLoopMode;
  12. + (BUTimer *)timerWithTimeInterval:(NSTimeInterval)seconds
  13. target:(nullable id)target
  14. selector:(SEL)aSelector
  15. repeats:(BOOL)repeats;
  16. + (BUTimer *)timerWithTimeInterval:(NSTimeInterval)seconds
  17. repeats:(BOOL)repeats
  18. block:(void (^)(BUTimer *timer))block;
  19. - (BOOL)isValid;
  20. - (void)invalidate;
  21. - (BOOL)isScheduled;
  22. - (BOOL)scheduleNow;
  23. - (BOOL)pause;
  24. - (BOOL)resume; // 从起始时间恢复
  25. - (BOOL)resumeFromPauseTime; // 从暂停时间恢复
  26. - (NSTimeInterval)initialTimeInterval;
  27. @end
  28. NS_ASSUME_NONNULL_END