Is manually linking binary with libraries and frameworks necessary?

When you build your project, what makes a framework usable is a two-stage process. You first import the framework's header in order to compile and it must link to the framework's binary so that they can interact with each other during runtime.

But, how am I allowed to use the Apple's frameworks by only importing them and not linking them in to your target in the Build Phase ? For example, I've seen some people manually add MapKit to the Link Binary With Libraries section of Build Phase , but it works perfectly fine without doing so. What is the rule of thumb? Do I ever have to do this process manually? Do I have to make sure to do this for the 3rd party frameworks?

This is probably better asked over at the Apple Developer Xcode forum, or other Apple-specific resources. This is not just about Swift, but is applicable to other languages

This is true, but Swift and Clang perform autolinking, which means they automatically generate the appropriate linker commands when a framework is imported.

Does this mean I normally don't have to worry about manually linking the frameworks?

Yep!

Terms of Service

Privacy Policy

Cookie Policy