-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Application Development with Swift
By :
As an iOS developer, before Apple released Swift, you may feel worried about your old code in Objective-C and wonder if you can use them together. The answer is yes, you can use Swift and Objective-C together in a single project, and everything will be fine, irrespective of whether the project was originally in Swift or Objective-C. This compatibility is very important in making the language easy to use and has been welcomed by all developers. So, you can use Objective-C frameworks (system frameworks or your custom frameworks) in Swift, and you can use Swift API's in Objective-C code.
To import some of your old Objective-C files in the Swift project, you will need a bridging header file to expose these files to Swift. Xcode offers to create the bridging header file for you once you add a Swift file in an Objective-C project or vice versa. Check the following image, where Xcode asks you to create...