dkahgld

NSBundle+FMListPlaceholder.m 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // NSBundle+FMListPlaceholder.m
  3. // FMListPlaceholderExample
  4. //
  5. // Created by Mingo on 2018/8/9.
  6. // Copyright © 2017年 袁凤鸣. All rights reserved.
  7. // 项目地址:https://github.com/yfming93/FMListPlaceholder
  8. // 作者博客:https://www.yfmingo.cn
  9. //
  10. #import "NSBundle+FMListPlaceholder.h"
  11. #import "FMListPlaceholder.h"
  12. @implementation NSBundle (FMListPlaceholder)
  13. + (instancetype)fm_listPlaceholderBundle
  14. {
  15. static NSBundle *fmListPlaceholderBundle = nil;
  16. if (fmListPlaceholderBundle == nil) {
  17. fmListPlaceholderBundle = [NSBundle bundleForClass:[FMListPlaceholder class]];
  18. }
  19. return fmListPlaceholderBundle;
  20. }
  21. + (UIImage *)fm_coverImage
  22. {
  23. static UIImage *coverImage = nil;
  24. if (coverImage == nil) {
  25. NSString *path = [[self fm_listPlaceholderBundle] pathForResource:@"fm_emptylist_placeholder@2x" ofType:@"png"];
  26. coverImage = [[UIImage imageWithContentsOfFile:path] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  27. }
  28. return coverImage;
  29. }
  30. @end