SCLTimerDisplay.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // SCLTimerDisplay.h
  3. // SCLAlertView
  4. //
  5. // Created by Taylor Ryan on 8/18/15.
  6. // Copyright (c) 2015-2017 AnyKey Entertainment. All rights reserved.
  7. //
  8. // Taken from https://stackoverflow.com/questions/11783439/uibutton-with-timer
  9. #if defined(__has_feature) && __has_feature(modules)
  10. @import UIKit;
  11. #else
  12. #import <UIKit/UIKit.h>
  13. #endif
  14. #import "SCLButton.h"
  15. @interface SCLTimerDisplay : UIView {
  16. CGFloat currentAngle;
  17. CGFloat currentTime;
  18. CGFloat timerLimit;
  19. CGFloat radius;
  20. CGFloat lineWidth;
  21. NSTimer *timer;
  22. SCLActionBlock completedBlock;
  23. }
  24. @property CGFloat currentAngle;
  25. @property NSInteger buttonIndex;
  26. @property (strong, nonatomic) UIColor *color;
  27. @property (assign, nonatomic) BOOL reverse;
  28. - (instancetype)initWithOrigin:(CGPoint)origin radius:(CGFloat)r;
  29. - (instancetype)initWithOrigin:(CGPoint)origin radius:(CGFloat)r lineWidth:(CGFloat)width;
  30. - (void)updateFrame:(CGSize)size;
  31. - (void)cancelTimer;
  32. - (void)stopTimer;
  33. - (void)startTimerWithTimeLimit:(int)tl completed:(SCLActionBlock)completed;
  34. @end