Simplifying Swift Framework Development
@_exportedwill make animport-ed module visible to the entire module into which its been imported. This means you don’t have toimport Dependencyin every file you need it. You just@_exportedthat dependency once, and you’re good to go in any file in that module.[…]
Second, I define a
publicconstant that is the name of the framework, and whose value is theBundlefor that framework. I use the class-based look up (ie, find the bundle that declares this class), because it’s one of the few convenientBundleinitializers that doesn’t return aBundle?, and thus I don’t have to deal with unwrapping. And then I use a special marker class for making that lookup resilient in the face of other functionality changes.