How do I configure cocoapods so that running pod install results in the storyboard having ProjectName checked for target membership?
I have a framework and an app that are both created by my company. We use Artifactory and Cocoapods to deploy the framework and pull it into the app. The framework contains a storyboard that is then used by the app to present a form. I am using XCode 8
Pod targets created by 'pod install'
The problem is that the targets created by running 'pod install' have to be manually updated.
The storyboard from the framework only has the target membership checked for ProjectName-ProjectName. If I run the app I get the following exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'ProjectName' in bundle NSBundle...
let bundle = NSBundle.init(forClass: ProjectNameViewController.classForCoder())]
let storyboard = UIStoryboard(name: "ProjectName", bundle: bundle)
If I manually go to the storyboard and check the target membership for ProjectName this works as expected.
used to deploy framework
Pod::Spec.new do |spec|
spec.name = 'ProjectName'
spec.version = '0.3.1'
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.summary = 'Summary.'
spec.homepage = 'http://COMPANYWEBSITE'
spec.authors = 'Author'
spec.source = { :git => 'https://github.com/ProjectName.git',
:tag => spec.version.to_s, :submodules => true }
spec.requires_arc = true
spec.ios.deployment_target = '8.2'
spec.framework = 'Foundation, UIKit'
spec.source_files = 'ProjectName/**/*.{swift}'
spec.resource_bundle = { 'ProjectName' => ['ProjectName/Resources/**/*'] }
end
used to pull framework into app
use_frameworks!
plugin 'cocoapods-art', :sources => [
'companyname-public'
]
target 'ProjectNameTest' do
pod 'ProjectName'
end
I was able to resolve this by changing:
spec.resource_bundle = { 'ProjectName' => ['ProjectName/Resources/**/*'] }
to
spec.resources = 'ProjectName/Resources/**/*'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With