How to use images asset catalog in cocoapod library for iOS

前端 未结 11 2404
粉色の甜心
粉色の甜心 2020-12-15 16:38

I have a cocoapod library which contains assets in 2 formats:

  • a .storyboard
  • XCode asset catalog .xcassets (with images)

my podsp

11条回答
  •  情书的邮戳
    2020-12-15 17:33

    You can access images from pods by using their bundle id

     NSBundle * bundle = [NSBundle bundleWithIdentifier:@"bundle id of your pod"];
    UIImage * image = [UIImage imageNamed:@"imageName" inBundle:bundle compatibleWithTraitCollection:nil];
    

提交回复
热议问题