Using Swift and Objective-C together in the same project

In this section, we will be walking through how to add Swift to an Objective-C project. As we just mentioned, the same steps can also be used to add the Objective-C code to a Swift project.

Creating the project

Let's begin by creating an iOS project to work with. When we first start Xcode, we should see a screen that looks similar to the following screenshot:

Creating the project

From this menu, we will want to select the Create a new Xcode project option. This option will walk us though creating a new Xcode project. Once this option is selected, Xcode will start up and we will see the following menu. As a shortcut, ...

Get Mastering Swift 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.