ios

Using Objective C and Swift 2.0 together in a Mixed Project

Since the announcement of Swift and XCode 6, Objective C and Swift files can be used together in within the same project. However even with XCode 7 out, using the two languages together is not very straightforward and the Apple documentation doesn’t provide a working example to demonstrate this usage.

As I’m working on production applications that use Swift and Objective C together, I put together an example project and documentation to demonstrate how to:

  1. Use Objective C classes from Swift (including unit testing Objective C components from Swift code)
  2. Use Swift classes from Objective C (including testing of Swift components with Objective C code)

See the full sample and documentation on GitHub – Using Objective C and Swift 2.0 together in a Mixed Project.

 Scroll to top