May sound silly, but just wanted to make sure that if I import /declare a module in Swift, say:
And use none of its definitions, will the Xcode compiler not include it in the build?
Code Block #import GameplayKit
And use none of its definitions, will the Xcode compiler not include it in the build?
Yes, it is ignored.
Interesting reference here:
https ://thoughtbot. com/blog/swift-imports
Interesting reference here:
https ://thoughtbot. com/blog/swift-imports
As far as performance and binary size goes, any unused symbols are already optimized out of the final binary by the Swift compiler. If there’s no reference to it at compile time then it’s removed, meaning that importing a framework but not using particular parts of it shouldn’t have any negative implications.