>> 
>> I think my other reply will make this a moot point, but since [NSBundle 
>> bundleForClass:] takes a Class, and you know what your class is, just pass 
>> it that, you don't have to reference self.
>> 
>> [NSBundle bundleForClass:[MyGroovySubclass class]];
> 
> Sorry, I was conflating Obj-C and Swift syntax. I'm trying to do this all in 
> swift, in which case it's:
> 
>       NSBundle(forClass: self.dynamicType)
> 
> But you can't call this in an initializer before calling super init.

Hi Rick,

In my test target to access resources needed by the tests I do:

let testBundle = NSBundle(forClass: MovingImagesFrameworkiOSSwift.self)

Where MovingImagesFrameworkiOSSwift is the Swift class.

Kevin


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to