Swift: Support for building more granular, reusable features.
| Originator: | raphael | ||
| Number: | rdar://23247490 | Date Originated: | 24-Oct-2015 12:06 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 7.1 |
| Classification: | Feature (New) | Reproducible: | Not Applicable |
A great way to build apps is to factor out reusable code to reuse it in new apps. Over time with Obj-C, we have settled on using many static libs for granular features, and frameworks mixing those static libs as a share point between apps & extensions. This is a great combination, for the following reasons: - static libs can be arbitrarily small, making it easy to separate features. They don't incur launch time penalty, nor build complications. - Having many small frameworks to replace static libs is not efficient as dynamic linking is required when app launches. - Having large, monolithic frameworks is not space efficient. Moreover, it embed unnecessary features, because frameworks don't know in advance which features are used. In current version of Swift, only frameworks are possible, there is no support for static libraries. For the reasons enumerated above, this makes it unsuitable to write reusable libraries, reducing it to write app-only code. Please consider adding a mechanism (static libs, or something else) for building granular features in Swift so that we can start building reusable code libraries.
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!