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:
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, if we do not see this menu, we can also navigate to File | New | Project in the top menu bar, which will display the following menus:
This menu lets us select the type of project we will be creating and also what platform we are targeting (iOS or OS X). For this example, we will be targeting the iOS platform and creating a simple Single...