SGQRCodeScanView.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // SGQRCodeScanView.h
  3. // SGQRCodeExample
  4. //
  5. // Created by kingsic on 2017/8/23.
  6. // Copyright © 2017年 kingsic All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef enum : NSUInteger {
  10. /// 默认与边框线同中心点
  11. CornerLoactionDefault,
  12. /// 在边框线内部
  13. CornerLoactionInside,
  14. /// 在边框线外部
  15. CornerLoactionOutside
  16. } CornerLoaction;
  17. typedef enum : NSUInteger {
  18. /// 单线扫描样式
  19. ScanAnimationStyleDefault,
  20. /// 网格扫描样式
  21. ScanAnimationStyleGrid
  22. } ScanAnimationStyle;
  23. @interface SGQRCodeScanView : UIView
  24. /** 扫描样式,默认 ScanAnimationStyleDefault */
  25. @property (nonatomic, assign) ScanAnimationStyle scanAnimationStyle;
  26. /** 扫描线名 */
  27. @property (nonatomic, copy) NSString *scanImageName;
  28. /** 边框颜色,默认白色 */
  29. @property (nonatomic, strong) UIColor *borderColor;
  30. /** 边角位置,默认 CornerLoactionDefault */
  31. @property (nonatomic, assign) CornerLoaction cornerLocation;
  32. /** 边角颜色,默认微信颜色 */
  33. @property (nonatomic, strong) UIColor *cornerColor;
  34. /** 边角宽度,默认 2.f */
  35. @property (nonatomic, assign) CGFloat cornerWidth;
  36. /** 扫描区周边颜色的 alpha 值,默认 0.2f */
  37. @property (nonatomic, assign) CGFloat backgroundAlpha;
  38. /** 扫描线动画时间,默认 0.02s */
  39. @property (nonatomic, assign) NSTimeInterval animationTimeInterval;
  40. /** 添加定时器 */
  41. - (void)addTimer;
  42. /** 移除定时器 */
  43. - (void)removeTimer;
  44. @end