SDDisplayLink.h 1011 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import <Foundation/Foundation.h>
  9. #import "SDWebImageCompat.h"
  10. /// Cross-platform display link wrapper. Do not retain the target
  11. /// Use `CADisplayLink` on iOS/tvOS, `CVDisplayLink` on macOS, `NSTimer` on watchOS
  12. @interface SDDisplayLink : NSObject
  13. @property (readonly, nonatomic, weak, nullable) id target;
  14. @property (readonly, nonatomic, assign, nonnull) SEL selector;
  15. @property (readonly, nonatomic) CFTimeInterval duration;
  16. @property (readonly, nonatomic) BOOL isRunning;
  17. + (nonnull instancetype)displayLinkWithTarget:(nonnull id)target selector:(nonnull SEL)sel;
  18. - (void)addToRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode;
  19. - (void)removeFromRunLoop:(nonnull NSRunLoop *)runloop forMode:(nonnull NSRunLoopMode)mode;
  20. - (void)start;
  21. - (void)stop;
  22. @end