Re: Accessing the bundle of the call-site

2016-12-02 Thread Jens Alfke
> On Dec 1, 2016, at 10:21 PM, Rick Aurbach wrote: > > Thank you for confirming my suspicions. I know that Bundle won’t help. What I > was hoping for was a Swift runtime call that returned the current module name. Something equivalent to [NSBundle bundleForClass: [self

Re: Accessing the bundle of the call-site

2016-12-01 Thread Rick Aurbach
Jens, Thank you for confirming my suspicions. I know that Bundle won’t help. What I was hoping for was a Swift runtime call that returned the current module name. Since (at least by convention), there is a correspondence between module names and framework names, I was hoping to derive a bundle

Re: Accessing the bundle of the call-site

2016-12-01 Thread Jens Alfke
Introspecting the call stack is possible, if somewhat ugly, using the backtrace and backtrace_symbols functions (on macOS/iOS.) But all you get is a list of PC and stack addresses, or function names. I don’t know how you’d go from those to an NSBundle object. On cursory inspection I didn’t see

Accessing the bundle of the call-site

2016-12-01 Thread Rick Aurbach
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