How to load resource in cocoapods resource_bundle

前端 未结 8 2043
说谎
说谎 2020-12-01 10:43

I have struggled a lot to how to load resource in cocoapods resource_bundle.

The following is what i put in the .podspecs file.

s.sourc         


        
8条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 10:58

    Interesting thing is when you need to do it in the source files that are also in the cocoapod library I faced it when used a xib and plist files in my pod.

    That was solved in the next way. Example of loading a xib file:

    let bundle = Bundle(for: self.classForCoder)
    let viewController = CocoapodViewController(nibName: "CocoapodViewController", bundle: bundle)
    

提交回复
热议问题