UIImage+MWPhotoBrowser.m 652 B

12345678910111213141516171819202122232425
  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. #import <UIKit/UIKit.h>
  10. @implementation UIImage (MWPhotoBrowser)
  11. + (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle {
  12. return [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]];
  13. }
  14. + (UIImage *)clearImageWithSize:(CGSize)size {
  15. UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
  16. UIImage *blank = UIGraphicsGetImageFromCurrentImageContext();
  17. UIGraphicsEndImageContext();
  18. return blank;
  19. }
  20. @end