UIImage+name.m 545 B

123456789101112131415161718192021
  1. //
  2. // UIImage+name.m
  3. // LenzCameraNativeModuleForRN
  4. //
  5. // Created by on 2023/2/4.
  6. //
  7. #import "UIImage+name.h"
  8. @implementation UIImage (name)
  9. + (instancetype)loadNamed:(NSString *)name{
  10. NSBundle *b= [NSBundle bundleWithURL:[[NSBundle bundleForClass:NSClassFromString(@"PCSBaseViewController")] URLForResource:@"LenzCameraNativeModuleForRN" withExtension:@"bundle"]];
  11. if (@available(iOS 8.0, *)) {
  12. return [UIImage imageNamed:name inBundle:b compatibleWithTraitCollection:nil];
  13. } else {
  14. return nil;
  15. }
  16. }
  17. @end