How to use Swift code in Objective-C

Apple told you about it, but not very clean. The process is actually pretty simple.

Xcode generates a header file for all your Swift code in the project, so you can use it in Objective-C. Yes, if you have multiple Swift files in your project, you shouldn’t think about what file you need to import — it’s just one for all Swift code. The file name of this header is "ModuleName-Swift.h". And we’ll set it up now in a few steps. Continue reading “How to use Swift code in Objective-C”

How to import a 3rd party framework into a Swift project

One day you’ll need to set up, let’s say, a mobile analytics system or a crash reports sender in your app. They are all useful, but some of them require you to import their framework into your Xcode project. Problem is, they’re now all written not using Swift Programming Language. In this little article I’ll tell you how to properly import a framework into your project. Continue reading “How to import a 3rd party framework into a Swift project”