FLEXUtility.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // FLEXUtility.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 4/18/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #define FLEXFloor(x) (floor([[UIScreen mainScreen] scale] * (x)) / [[UIScreen mainScreen] scale])
  11. @interface FLEXUtility : NSObject
  12. + (UIColor *)consistentRandomColorForObject:(id)object;
  13. + (NSString *)descriptionForView:(UIView *)view includingFrame:(BOOL)includeFrame;
  14. + (NSString *)stringForCGRect:(CGRect)rect;
  15. + (UIViewController *)viewControllerForView:(UIView *)view;
  16. + (NSString *)detailDescriptionForView:(UIView *)view;
  17. + (UIImage *)circularImageWithColor:(UIColor *)color radius:(CGFloat)radius;
  18. + (UIColor *)scrollViewGrayColor;
  19. + (UIColor *)hierarchyIndentPatternColor;
  20. + (NSString *)applicationImageName;
  21. + (NSString *)applicationName;
  22. + (NSString *)safeDescriptionForObject:(id)object;
  23. + (UIFont *)defaultFontOfSize:(CGFloat)size;
  24. + (UIFont *)defaultTableViewCellLabelFont;
  25. + (NSString *)stringByEscapingHTMLEntitiesInString:(NSString *)originalString;
  26. + (UIInterfaceOrientationMask)infoPlistSupportedInterfaceOrientationsMask;
  27. + (NSString *)searchBarPlaceholderText;
  28. + (BOOL)isImagePathExtension:(NSString *)extension;
  29. + (UIImage *)thumbnailedImageWithMaxPixelDimension:(NSInteger)dimension fromImageData:(NSData *)data;
  30. + (NSString *)stringFromRequestDuration:(NSTimeInterval)duration;
  31. + (NSString *)statusCodeStringFromURLResponse:(NSURLResponse *)response;
  32. + (NSDictionary *)dictionaryFromQuery:(NSString *)query;
  33. + (NSString *)prettyJSONStringFromData:(NSData *)data;
  34. + (NSData *)inflatedDataFromCompressedData:(NSData *)compressedData;
  35. @end