FUBeautyComponentManager.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // FUBeautyComponentManager.h
  3. // FUBeautyComponentManager
  4. //
  5. // Created by 项林平 on 2022/6/10.
  6. //
  7. #import <UIKit/UIKit.h>
  8. #import "FUBeautyDefine.h"
  9. #import "FUBeautySkinView.h"
  10. #import "FUBeautyShapeView.h"
  11. #import "FUBeautyFilterView.h"
  12. #import "FUCommonUIComponent.h"
  13. #import <FURenderKit/FURenderKit.h>
  14. NS_ASSUME_NONNULL_BEGIN
  15. @protocol FUBeautyComponentDelegate <NSObject>
  16. @optional
  17. - (void)beautyComponentViewHeightDidChange:(CGFloat)height;
  18. - (void)beautyComponentDidTouchDownComparison;
  19. - (void)beautyComponentDidTouchUpComparison;
  20. /// 提示
  21. - (void)beautyComponentNeedsDisplayPromptContent:(NSString *)content;
  22. @end
  23. @interface FUBeautyComponentManager : NSObject
  24. @property (nonatomic, strong) FUBeautySkinViewModel *beautySkinViewModel;
  25. @property (nonatomic, strong) FUBeautyShapeViewModel *beautyShapeViewModel;
  26. @property (nonatomic, strong) FUBeautyFilterViewModel *beautyFilterViewModel;
  27. @property (nonatomic, weak) id<FUBeautyComponentDelegate> delegate;
  28. /// 美颜视图总高度
  29. @property (nonatomic, assign, readonly) CGFloat componentViewHeight;
  30. /// 美颜视图选中功能索引,默认-1,-1表示未选中
  31. @property (nonatomic, assign, readonly) NSInteger selectedIndex;
  32. + (instancetype)sharedManager;
  33. /// 销毁
  34. + (void)destory;
  35. /// 在目标视图中添加美颜组件视图(固定位置为目标视图底部)
  36. /// @param view 目标视图
  37. - (void)addComponentViewToView:(UIView *)view;
  38. /// 在父视图中移除美颜组件视图
  39. - (void)removeComponentView;
  40. /// 加载美颜效果
  41. - (void)loadBeauty;
  42. /// 卸载当前加载的美颜
  43. - (void)unloadBeauty;
  44. /// 保存当前美颜数据到本地
  45. - (void)saveBeauty;
  46. @end
  47. NS_ASSUME_NONNULL_END