WBStatusHelper.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // WBFeedHelper.h
  3. // YYKitExample
  4. //
  5. // Created by ibireme on 15/9/5.
  6. // Copyright (c) 2015 ibireme. All rights reserved.
  7. //
  8. #import "YYKit.h"
  9. #import "WBModel.h"
  10. /**
  11. 很多都写死单例了,毕竟只是 Demo。。
  12. */
  13. @interface WBStatusHelper : NSObject
  14. /// 微博图片资源 bundle
  15. + (NSBundle *)bundle;
  16. /// 微博表情资源 bundle
  17. + (NSBundle *)emoticonBundle;
  18. /// 微博表情 Array<WBEmotionGroup> (实际应该做成动态更新的)
  19. + (NSArray<WBEmoticonGroup *> *)emoticonGroups;
  20. /// 微博图片 cache
  21. + (YYMemoryCache *)imageCache;
  22. /// 从微博 bundle 里获取图片 (有缓存)
  23. + (UIImage *)imageNamed:(NSString *)name;
  24. /// 从path创建图片 (有缓存)
  25. + (UIImage *)imageWithPath:(NSString *)path;
  26. /// 圆角头像的 manager
  27. + (YYWebImageManager *)avatarImageManager;
  28. /// 将 date 格式化成微博的友好显示
  29. + (NSString *)stringWithTimelineDate:(NSDate *)date;
  30. /// 将微博API提供的图片URL转换成可用的实际URL
  31. + (NSURL *)defaultURLForImageURL:(id)imageURL;
  32. /// 缩短数量描述,例如 51234 -> 5万
  33. + (NSString *)shortedNumberDesc:(NSUInteger)number;
  34. /// At正则 例如 @王思聪
  35. + (NSRegularExpression *)regexAt;
  36. /// 话题正则 例如 #暖暖环游世界#
  37. + (NSRegularExpression *)regexTopic;
  38. /// 表情正则 例如 [偷笑]
  39. + (NSRegularExpression *)regexEmoticon;
  40. /// 表情字典 key:[偷笑] value:ImagePath
  41. + (NSDictionary *)emoticonDic;
  42. @end