Using Swift classes from Objective-C code

suggest change

In the same module

Inside a module named “MyModule”, Xcode generates a header named MyModule-Swift.h which exposes public Swift classes to Objective-C. Import this header in order to use the Swift classes:

public
#import "MyApp-Swift.h"
#import <MyFramework/MyFramework-Swift.h>

Relevant build settings:


In another module

Using @import MyFramework; imports the whole module, including Obj-C interfaces to Swift classes (if the aforementioned build setting is enabled).

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents