It ' s a new feature called Modules or "semantic import". There ' s more info in the WWDC Session 205 & 404 Videos. It ' s kind of a better implementation of the pre-compiled headers. You can use modules with any of the system frameworks in IOS 7 and Mavericks. They is a packaging together of the framework executable and it ' s headers and is touted as being safer and more Efficien T than #import .
one of the big advantages of using @import is that you don't have the to add the framework for you want I n the project settings, it ' s done automatically. That means so can skip the step where you click the plus button and search for the Framework (Golden Toolbox), then Move it to the "frameworks" group. It would save many developers from the cryptic "Linker error" messages.
also, you don't actually need to use the @import keyword. If you opt-in to using modules, all #import and #include directives is mapped to use @import automatically. That means, you don ' t has to change your source code (or the source code of libraries, that's download from Elsewher e). Supposedly using modules improves the build performance too, especially if you haven ' t been using pchs well or if your Project has many small source files.
Modules is enabled by default in new projects in Xcode 5. To enable them in a older project, go into your project build settings, search for "Modules" and set "Enable Modules" to "YES". The "Link frameworks" should be "YES" too:
You are using Xcode 5 and the iOS 7 or Mavericks SDK, but can still release for older OSs (say IOS 4.3 or whate ver). Modules don ' t change how your code was built or any of the source code. You can ' t use them for your own frameworks.
From the WWDC slides:
-
Imports Complete Semantic Description of a framework
-
doesn ' t need to parse the headers
-
Better to import a framework ' s interface
-
Loads binary representation
-
More flexible than precompiled headers
-
Immune to effects of local macro definitions (e.g. #define readonly 0x01 )
-
Enabled for new projects by default
To explicitly use modules:
Replace with #import <Cocoa/Cocoa.h>@import Cocoa;
You can also import just one header with this notation:
@import Iad.adbannerview;
The Submodules autocomplete for your in Xcode.
@import vs #import-ios 7