Does anyone know if it is possible to do the following in Swift 3.x? (I’ll 
describe the issue abstractly first, then give the use-case.)

Consider two modules: A and B. A could be either the main module of an 
application or an embedded framework. B is a different embedded framework.

Now A contains an public extension of class X which contains a function f(). 
Inside B, there is a reference to X.f(). Now what I want to do in f() is to 
access information (a module name or bundle name or bundle ID or something) 
that allows me to construct a Bundle object referring to B, without f() having 
any external knowledge of the organization of the application.

The use-case I’m thinking about is a localization extension of String that 
works in a multi-framework application architecture without requiring the 
caller to specify the name of the framework and/or module.

I.e., “foo”.localize() would access the localized.strings file for the 
framework in which it was called.

Is this possible? If so, can you give me a few pointers on how to make this 


Rick Aurbach


Cocoa-dev mailing list (

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

Help/Unsubscribe/Update your Subscription:

This email sent to

Reply via email to