HWDimmedView.h 945 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // HWDimmedView.h
  3. // HWPanModal
  4. //
  5. // Created by heath wang on 2019/4/26.
  6. //
  7. #import <UIKit/UIKit.h>
  8. @class HWBackgroundConfig;
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_ENUM(NSInteger, DimState) {
  11. DimStateMax,
  12. DimStateOff,
  13. DimStatePercent,
  14. };
  15. typedef void(^didTap)(UITapGestureRecognizer *recognizer);
  16. @interface HWDimmedView : UIView
  17. @property (nonatomic, assign) DimState dimState;
  18. @property (nonatomic, assign) CGFloat percent;
  19. @property (nullable, nonatomic, copy) didTap tapBlock;
  20. @property (nullable, nonatomic, strong) UIColor *blurTintColor;
  21. @property (nonatomic, readonly) HWBackgroundConfig *backgroundConfig;
  22. /**
  23. * init with the max dim alpha & max blur radius.
  24. */
  25. - (instancetype)initWithDimAlpha:(CGFloat)dimAlpha blurRadius:(CGFloat)blurRadius;
  26. - (instancetype)initWithBackgroundConfig:(HWBackgroundConfig *)backgroundConfig;
  27. - (void)reloadConfig:(HWBackgroundConfig *)backgroundConfig;
  28. @end
  29. NS_ASSUME_NONNULL_END