Utils.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Utils.h
  3. // iosapp
  4. //
  5. // Created by chenhaoxiang on 14-10-16.
  6. // Copyright (c) 2014年 oschina. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "UIColor+Util.h"
  10. #import "UIImageView+Util.h"
  11. #import "UIImage+Util.h"
  12. #import "NSTextAttachment+Util.h"
  13. typedef NS_ENUM(NSUInteger, hudType) {
  14. hudTypeSendingTweet,
  15. hudTypeLoading,
  16. hudTypeCompleted
  17. };
  18. @class MBProgressHUD;
  19. @interface Utils : NSObject
  20. + (NSDictionary *)emojiDict;
  21. + (NSAttributedString *)getAppclient:(int)clientType;
  22. + (NSString *)generateRelativeNewsString:(NSArray *)relativeNews;
  23. + (NSString *)generateTags:(NSArray *)tags;
  24. + (NSAttributedString *)emojiStringFromRawString:(NSString *)rawString;
  25. + (NSAttributedString *)emojiStringFromAttrString:(NSAttributedString*)attrString;
  26. + (NSAttributedString *)attributedStringFromHTML:(NSString *)HTML;
  27. + (NSData *)compressImage:(UIImage *)image;
  28. + (NSString *)convertRichTextToRawText:(UITextView *)textView;
  29. + (BOOL)isURL:(NSString *)string;
  30. + (NSInteger)networkStatus;
  31. + (BOOL)isNetworkExist;
  32. + (CGFloat)valueBetweenMin:(CGFloat)min andMax:(CGFloat)max percent:(CGFloat)percent;
  33. + (MBProgressHUD *)createHUD;
  34. + (UIImage *)createQRCodeFromString:(NSString *)string;
  35. + (NSAttributedString *)attributedTimeString:(NSDate *)date;
  36. + (NSAttributedString *)attributedCommentCount:(int)commentCount;
  37. @end