UIImage+MWPhotoBrowser.m 628 B

123456789101112131415161718192021222324
  1. //
  2. // UIImage+MWPhotoBrowser.m
  3. // Pods
  4. //
  5. // Created by Michael Waterfall on 05/07/2015.
  6. //
  7. //
  8. #import "UIImage+MWPhotoBrowser.h"
  9. @implementation UIImage (MWPhotoBrowser)
  10. + (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle {
  11. return [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]];
  12. }
  13. + (UIImage *)clearImageWithSize:(CGSize)size {
  14. UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
  15. UIImage *blank = UIGraphicsGetImageFromCurrentImageContext();
  16. UIGraphicsEndImageContext();
  17. return blank;
  18. }
  19. @end