Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resources in custom iOS frameworks

I have made an empty single-view application in Xcode 6 (FWTest) and added a Cocoa Touch Framework (FWTestKit) as a target and asked it to embed in FWTest. Then I add an image (photo.png) to the framework, that I expect to be in Frameworks/FWTestKit.framework/Versions/A/Resources/photo.png when I build & archive my app. However, I find it in Frameworks/FWTestKit.framework/photo.png

How can I make it at least be in a Resources folder? Preferably a versioned folder so I can ship different versions of my framework?

When I add this framework to another app, do I need to do anything special to make sure the resources are bundled along with it, so that when I reference a resource from within my framework I can be sure it'll be available also when used in another app?

Cheers

Nik

like image 493
niklassaers Avatar asked Sep 29 '22 20:09

niklassaers


1 Answers

step1If the desired structure is]![step2You should add your photo.png into separate folder (let's call it "gica" ). Then drag folder into project, check Copy items if needed and create folder reference. Then (important) in build phases, drag photo.png again in Copy Bundle Resources, keeping Copy items if needed and create folder references. After you compile you should have now desired folder structure [It is keeping gica/photo.png].enter image description here

like image 53
ares777 Avatar answered Oct 05 '22 07:10

ares777