Setting up your project
Setting up for Swift from an existing Objective-C project just takes a minute and Xcode is usually able to do it for you, but in case you're lost, you've faced an issue, or you want to know exactly how everything works, this section is for you.
Importing Objective-C in Swift
This is usually how we discover the interoperability layer. An existing Objective-C code base is getting upgraded to Swift and you need to expose existing Objective-C classes to your new Swift code.
In Swift, all of your classes are available in the current module, depending on their access control scopes. In Objective-C, one developer need is to import a header through the #import "MyClass.h"
directive or the module through @import ExternalLibrary
. In order to expose your classes to Swift, you'll need to use a bridging header. Its responsibility is to expose only the classes you wish to the Swift compiler.
The bridging header is a header file that contains all of the import statements of the libraries...