How to load resource in cocoapods resource_bundle

前端 未结 8 2079
说谎
说谎 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 11:08

    It seems like for some reason **/*.{extensions} pattern is required for this to work I ended up creating my podspec like this

    s.resource_bundle = { '' => 'Pod/Resources/**/*.storyboard' }
    s.resource = 'Pod/Resources/**/*.storyboard'
    

    even though my actual path is Pod/Resources/.storyboard*

    And then to find my bundle I used @Jhelzer's answer although any way to get bundle e.g. by class or URL or bundleID will work after above setup.

    You can also have a look into this answer for more refrences.

提交回复
热议问题