Sto provando a modulare un grande progetto iOS (in fase di sviluppo in Swift) utilizzando i pod di cacao. L'idea è di creare "subapp" complete di storyboard e risorse che potrebbero essere integrate nel progetto principale.Utilizzo di storyboard e risorse immagine in Cocoapod personalizzati
Sto avendo problemi con gli storyboard in uno scenario del genere. Il problema è simile a (credo): https://github.com/CocoaPods/CocoaPods/issues/2597
Ecco la .podspec del modulo che sto cercando di convertire in un baccello:
Pod::Spec.new do |spec|
spec.name = 'GlycoAppMenuModule'
spec.version = '0.0.8'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.homepage = 'https://google.com'
spec.platform = :ios, "8.0"
spec.authors = { 'Abdulla Contractor' => '[email protected]' }
spec.summary = 'Views for menu page'
spec.source = { :git => 'https://github.com/Holmusk/GlycoAppMenuModule.git', :tag => '0.0.8' }
spec.source_files = 'GlycoAppMenuModule/*'
spec.resource_bundles = {
'resources' => ['GlycoAppMenuModule/**/*.{lproj,storyboard}']}
# spec.framework = 'Foundation'
end
e qui è il codice che uso per tentare di utilizzare lo storyboard
let bundlePath = NSBundle(forClass: GANavigationMenuViewController.self).pathForResource("resources", ofType: "bundle")
let bundle = NSBundle(path: bundlePath!)
let storyboard: UIStoryboard = UIStoryboard(name: "Menu", bundle: bundle)
let vc = storyboard.instantiateInitialViewController() as! UIViewController
self.presentViewController(vc, animated: false, completion: nil)
questo è l'errore che ottengo
2015-06-05 11:39:40.365 temp[3593:50802] Unknown class _TtC9resources30GANavigationMenuViewController in Interface Builder file.
2015-06-05 11:39:40.370 temp[3593:50802] Could not load the "icAccount.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.371 temp[3593:50802] Could not load the "icConnect.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.371 temp[3593:50802] Could not load the "icDiabetesProfile.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.373 temp[3593:50802] Could not load the "icLogout.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.377 temp[3593:50802] Could not load the "icCircle.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.386 temp[3593:50802] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fb3f3d2cdd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key accountButton.'
Qualche idea di cosa possa mancare?
Sembra un problema simile http://stackoverflow.com/questions/3088059/che-segue-questo-mano-nsunknownkeyexception-reasonthis-class-is-not-key-valu –