Reputation: 767
I want to add a library to my Swift project. I found 3 different places to add.
I want to know the correct way to do this and the purpose of each one.
select the target -> general
select the target -> build phase
select the target -> click on + button -> select "New copy file phase"
Upvotes: 7
Views: 15176
Reputation: 59
"Binary" means: compiled code — as opposed to "source code", which is what you are working with when you write code as text.
They could have given you source code and let you compile it, but they didn't; they are keeping the source code secret, so they've given it all to you after compilation, so that you can't read it.
"Embedded" means: to be included inside your app bundle, by copying them into it at build time.
So, they are handing you some compiled code (frameworks) and telling you how to include them inside your app bundle. These frameworks, unlike Cocoa's frameworks, do not already exist on the device, so if you don't include them inside the app, they won't be present and your app would be unable to call into them.
Contrast this to Cocoa's frameworks. They, too, are compiled code. But they do already exist on the device. Therefore they are not embedded inside your app; they are merely linked (and, if they appeared, would appear in the next group, Linked Frameworks and Libraries). What are Embedded Binaries in Xcode?
Upvotes: 4
Reputation: 2326
1.Select the project file from the project navigator on the left side of the project window.
2.Select the target for where you want to add frameworks in the project settings editor.
3.Select the “Build Phases” tab, and click the small triangle next to “Link Binary With Libraries” to view all of the frameworks in your application.
4.To Add frameworks, click the “+” below the list of frameworks.
5.To select multiple frameworks, press and hold the command key while using the mouse to click the desired frameworks.
Upvotes: 5