[swift-corelibs-dev] Implementing Bundle.init(for aClass: AnyClass)
Tony Parker
anthony.parker at apple.com
Fri Nov 18 11:15:39 CST 2016
Hi Mamatha,
> On Nov 18, 2016, at 3:03 AM, Mamatha Busi via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
>
> Hi
>
>
>
> init(for aClass: AnyClass) is an unimplemented API on Linux. I am exploring around this to implement the same and have a couple of queries:
>
>
>
> -> In the context of Linux platform, how relevant is this API for loading bundles dynamically?
>
>
On Darwin, this API really only works if the bundle is already loaded. It’s more about getting the NSBundle instance for a particular class.
>
> -> In a Bundle, how do I go about getting information on the classes that are available within it?
>
>
>
On Darwin (again) we ask dyld for the library that holds the pointer for the class info, then use further dyld functions to find the path for that library, and use that info to construct the bundle.
These seem reasonable on Linux and in Swift, if we can get some kind of metadata about the class.
- Tony
> Any related insights/suggestions would help.
>
>
>
> Thanks
>
>
> Mamatha
>
>
>
>
>
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20161118/ad7248cb/attachment.html>
More information about the swift-corelibs-dev
mailing list