25

I am using Xcode 6 and following an Xcode version 4 tutorial so things are different here and there.

There doesn't seem to be a Frameworks folder in my project navigator and so when I downloaded some .framework files and added them manually in the build phase of my project editor, I had no Frameworks folder to save them in and just let them fall into the top of my project navigator. So they are there, just not in a special folder, and it doesn't look good.

So should Xcode 6 have a frameworks folder automatically, or do I need to create one myself? And if so, how can I do that? (I've only added new files so far).

cheznead
  • 2,589
  • 7
  • 29
  • 50

4 Answers4

49

In Xcode 6, the Frameworks folder is not added by default. You can drag and drop your .framework files into the project navigator (tick 'Copy items if needed'), then select them all > right click > "New Group from Selection" and name the folder 'Frameworks'.

Also, make sure the frameworks are added into the Project > Build Phases > Link Binary With Libraries. If not, drag them there from your newly created 'Frameworks' folder.

Sebyddd
  • 4,305
  • 2
  • 39
  • 43
5

In short, no, you shouldn't need to create a Frameworks group yourself as Xcode is doing stuff automatically for you...

Apple are slowly, gently pushing developers in the direction of newer Clang features with the goal of making native iOS development more approachable for newbies who don't have previous experience of compiling and linking with C-based languages.

You'll find that Objective-C projects created with Xcode 6 have new build settings enabled by default including Link Frameworks Automatically (CLANG_MODULES_AUTOLINK) and Enable Modules (C and Objective-C) (CLANG_ENABLE_MODULES).

Suggested reading:

Community
  • 1
  • 1
Quintin Willison
  • 610
  • 6
  • 13
  • Thanks Quintin. I've had a look at Swift and it looks pretty appealing to me as one of aforementioned newbies.. good idea to shelve obj-c for now? would be glad to get your opinion. – cheznead Nov 24 '14 at 15:11
  • I have, as yet, not had any time to expose myself to Swift so I couldn't say for sure. It's going to depend on what you're developing. If I were producing a greenfield app then I would seriously consider it. However, for library developers I understand it's currently a non-starter (at least for public interfaces due to Apple's lack of willingness to commit to future binary compatibility - see [here](https://developer.apple.com/swift/blog/?id=2))... Equally, both Xcode and Objective-C are getting progressively 'easier' to use so I would persist with learning the aboriginal toolkit if you can! – Quintin Willison Nov 24 '14 at 15:43
  • I want to develop both games and apps. I like how sparse and clean swift looks but will keep going with obj-c for a while and learn swift alongside I guess! – cheznead Nov 24 '14 at 17:33
2

I found the other answers too confusing (where am I supposed to get .framework files?)

It's way simpler in Xcode 6. Just go to Capabilities and turn Maps on. That's it... really.

stevebot
  • 23,275
  • 29
  • 119
  • 181
  • 1
    It's fairly simple actually. Just create a 'Frameworks' folder in Xcode and add the framework files to it. :) – Sebyddd Jun 01 '15 at 19:07
  • @Sebyddd then you have to locate the framework files first. This is not my definition of simple, much easier to just click a checkbox. – stevebot Jun 02 '15 at 17:17
  • What do you exactly mean by 'locating the framework files'? Once you got the .framework file, it's as easy as adding it to the user-created 'Frameworks' folder in Project Navigator. It's usually added to build phases automatically, as well. – Sebyddd Jun 02 '15 at 17:23
  • @Sebyddd yes 'once you get the framework file'. The annoying part is having to track down the .framework file first and then copy it. it's at least 5 steps instead of one. – stevebot Jun 03 '15 at 05:02
  • also, Xcode has the functionality built in, so why wouldn't you use what they built for you? – stevebot Jun 03 '15 at 05:02
  • Are you talking about 3rd party frameworks or the iOS provided ones? You don't have to track down system frameworks. You can just add them in 'Link binary with files'. For 3rd party frameworks it's still as easy. You usually download the .framework file from a vendor and just drag it into Xcode. – Sebyddd Jun 03 '15 at 05:06
  • @Sebyddd for system frameworks that is still not as intuitive as using the method that Xcode has built in for you – stevebot Jun 03 '15 at 15:17
  • You're right, but in this case the question is about 3rd party frameworks. :) – Sebyddd Jun 03 '15 at 17:19
  • I can't turn off the Maps capability any more and I don't need it. How do I get rid of the Maps capability one I used it to create the frameworks folder? – Gerd Castan Sep 28 '16 at 22:21
1

I would recommend using drag and drop feature to move files into Xcode. Xcode show you the Choose options for adding these files window [Copy items if needed] [Added folders]

For example Xcode can automatically add relative path ($(PROJECT_DIR)/) to:

  • Build Settings -> Library Search Paths if you drag and drop a library
  • Build Settings -> Framework Search Paths if you drag and drop a framework
yoAlex5
  • 29,217
  • 8
  • 193
  • 205