[swift-users] Discrepancy between sharing internal Swift symbols with Obj-C when in an app vs a framework target

Jens Alfke jens at mooseyard.com
Sat Jun 4 01:35:07 CDT 2016


> On Jun 3, 2016, at 7:55 PM, Kevin Lundberg via swift-users <swift-users at swift.org> wrote:
> 
> swift code in an app target can be accessed from obj-c if it is internal
> or public. However, swift code in a framework target can only be
> accessed from objc if it is public, not internal.

That’s exactly what the access modifiers are supposed to do. A framework is by definition a separate package from the binary that imports it, so only public symbols are visible.

This doesn’t only apply to Obj-C code, either. Swift code in your app won’t be able to use internal APIs of Swift code from the framework, either.

> would swift-evolution be the proper place to discuss changing this behavior?


This seems to be pretty clearly the correct behavior, so I can’t see it being changed.

—Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160603/82f7a554/attachment.html>


More information about the swift-users mailing list