iOS 8: get resource from Cocoa Touch Framework -
to share code , resources between app , extensions, embed cocoa touch framework
in project, framework contains resources image , xib files.
my question is: how access resources may main app , extensions?
i used utilize method: ios 8 extension: how utilize xib within cocoa touch framework in extensions?
but make re-create resources in app's bundle , extensions' bundle, not repeat.
is there improve way?
update:
now main app can utilize code access resource in frameworks:
+(nsbundle*)frameworkbundle { nsstring *frameworkdirpath = [[nsbundle mainbundle] privateframeworkspath]; nsstring *frameworkbundlepath = [frameworkdirpath stringbyappendingpathcomponent:@"myframework.framework"]; nsbundle *frameworkbundle = [nsbundle bundlewithpath:frameworkbundlepath]; homecoming frameworkbundle; }
but doesn't work extensions.
try this:
nsbundle *frameworkbundle = [nsbundle bundleforclass:[anyclassfromframework class]];
ios cocoa-touch ios8
No comments:
Post a Comment