Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between dragging frameworks into framework folder and drag Link With Library?

Tags:

xcode

In Xcode, what is the difference between:

Dragging framework (i.e. LoginWithAmazon.framework) into framework folder in the project tree (left pane in Xcode)

compared to

drag-and-drop the framework into the 'Link With Libraries' in Targets->[Project Name]?

like image 761
ConfusedDeer Avatar asked Oct 24 '25 16:10

ConfusedDeer


1 Answers

The difference is that dragging a framework into your project won't necessarily link it to your binary (or target). Dragging a framework into your project (which you see in the Project Navigator) basically just puts it there until you actually link it with a target. With Apple's frameworks some of the linking is automatic, although for 3rd Party frameworks you'll almost always need to link them with your target.

Here's an example — you may have a project in which there are multiple targets, such as a iOS version and an OS X version. The iOS version might require a framework that OS X doesn't, although you can still have it's framework within your project. Since you wouldn't want to use that framework with the OS X target, you would only want to link it with the iOS target.

You can think of the frameworks dragged into your project almost as placeholders until you actually link them to a target.

like image 126
l'L'l Avatar answered Oct 26 '25 06:10

l'L'l



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!