HTMLAnalysisHelper.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // HTMLAnalysisHelper.h
  3. // HTMLAnalysisDemo
  4. //
  5. // Created by ztcj_develop_mini on 2019/3/25.
  6. // Copyright © 2019 ztcj_develop_mini. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #define kScreen_WIDTH [UIScreen mainScreen].bounds.size.width
  11. #define kDefaultFontSize 16.0
  12. #define kDefaultImgWidth kScreen_WIDTH
  13. #define kDefaultTextLineSpacing 2.0
  14. #define kDefaultParagraphSpacing (kDefaultTextLineSpacing * 2)
  15. @interface HTMLAnalysisHelper : NSObject
  16. @property (nonatomic, assign)CGFloat fontSize; //统一的字体大小
  17. @property (nonatomic, assign)CGFloat imageWidth; //图片宽度
  18. @property (nonatomic, assign)CGFloat textLineSpacing; //行间距
  19. @property (nonatomic, assign)CGFloat paragraphSpacing; //段间距
  20. @property (nonatomic, strong)NSMutableAttributedString *closeStr; //
  21. @property (nonatomic, strong)NSMutableAttributedString *openStr; //
  22. - (void)analysisWithHTMLStr:(NSString *)htmlStr;
  23. - (void)getImgUrlArrWithHTMLStr:(NSString *)htmlStr;
  24. @property (nonatomic, copy)void(^linkClickedBlock)(NSString *linkStr); //点击超链接
  25. @property (nonatomic, copy)void(^openCloseBlock)(void); //展开关闭
  26. @property (nonatomic, copy)void(^imageClickedBlock)(UIImage *image); //点击图片
  27. @end