Swift - ObjC interoperability: In a framework have a way to access private ObjC classes in Swift
Originator: | vytis.s.lt | ||
Number: | rdar://40871761 | Date Originated: | 06-Jun-2018 04:03 PM |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode 10.0 beta (10L176w) |
Classification: | Other Bug | Reproducible: | Always |
Summary: Currently only classes defined in public ObjC headers are visible to Swift. To avoid leaking implementation details it would be useful to have ability to extend framework private ObjC classes in Swift. Steps to Reproduce: 1. Have a mixed ObjC-Swift framework 2. Define a class “Foo” in ObjC and make the header private 3. Add a private module map that exports “FooFramework_Private” module with the header “Foo.h” from step #2 4. From Swift file do “import FooFramework_Private” and try to make “extension Foo {}” Expected Results: 5. Should be possible Actual Results: 5. Error building - “FooFramework_Private is not found” Version: Xcode 10.0 beta (10L176w) Notes: This was looked at by several people in WWDC Swift labs and seems to be a bug. Quote from Jordan Rose about the underlying reason: “VFS is interfering with finding the private module map because it’s trying to shadow the public module map”
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Experiencing the same behavior on Xcode 10.2
Any updates on this?