O'Reilly logo

Mastering Swift by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. The same steps can also be used to add the Objective-C code to a Swift project. In the downloadable code for this book, you will find both Objective-C and Swift projects. These projects demonstrate how to add the Swift code to an Objective-C project and how to add Objective-C code to a Swift project. In those projects, we can see that mix and match functions exactly the same no matter what type of project we are using.

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 like the one in the following screenshot:

From this menu, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required