What is the "@exported" attribute in Swift

This attribute officially does not exist. Unofficially, however, it is a way of opening a sub-framework's symbols into your own framework's scope and exporting them as though they were yours. For example, a testing framework might wish to declare an @exported XCTest somewhere so all it takes to use the framework is just import TestFramework.

Be warned, though the attribute is compatible with most swift versions and should compile fine, it will break code completion in creative ways on each individual build of Xcode - probably a big reason why it is not an official feature yet.

Tags:

Swift