Load image from CocoaPods resource bundle

后端 未结 7 2158
独厮守ぢ
独厮守ぢ 2021-02-02 11:48

I am creating a private library that includes resources that are referenced by components in the library. The library is shared with apps using CocoaPods. In the .podspec for

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-02 12:27

    As for me, I had to add the "s.resources" into the .podspec. Before this was missing.

    Only the s.resource_bundles were set this way: 'BPPicker/Assets/.', changed it to 'BPPicker/Assets/*' as well.

    #
    # Be sure to run `pod lib lint BPPicker.podspec' to ensure this is a
    # valid spec before submitting.
    #
    # Any lines starting with a # are optional, but their use is encouraged
    # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
    #
    
    Pod::Spec.new do |s|
      s.name             = 'BPPicker'
      s.version          = '0.1.11'
      s.summary          = 'This is the imito Body Part Picker.'
    
    # This description is used to generate tags and improve search results.
    #   * Think: What does it do? Why did you write it? What is the focus?
    #   * Try to keep it short, snappy and to the point.
    #   * Write the description between the DESC delimiters below.
    #   * Finally, don't worry about the indent, CocoaPods strips it!
    
      s.description      = <<-DESC
    TODO: Add long description of the pod here.
                           DESC
    
      s.homepage         = 'https://bitbucket.org/imito/bppicker'
      # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
      s.license          = { :type => 'MIT', :file => 'LICENSE' }
      s.author           = { 'Ievgen Naloiko' => 'naloiko@gmail.com' }
      s.source           = { :git => 'https://ievgen_naloiko@bitbucket.org/imito/bppicker.git', :tag => s.version.to_s }
      # s.social_media_url = 'https://twitter.com/'
    
      s.ios.deployment_target = '9.0'
    
      s.source_files = 'BPPicker/Classes/**/*'
    
      s.resource_bundles = {
        'BPPicker' => ['BPPicker/Assets/*']
      }
        s.resources = "BPPicker/**/*.{png,json}"
    
        s.frameworks = 'UIKit'
        s.dependency 'ObjectMapper'
    end
    

提交回复
热议问题