Updated May 2018 Xcode 9.3
- Build Settings->Objective-C Generated Interface Header Name
and set the value to YourModule-Swift.h (this is usually already set, this is the filename you need to import on .m file#import "YourModule-Swift.h"
(Example, Project named CData
)
-
Same as Step 1, Go to Build Settings and search for “Defines Module”, set both values to YES
-
Create a class that extends
NSObject
on.swift
file
-
Build the project again
-
Import
YourModule-Swift.h
file on .m file (Please notice it’s case sensitive,Mymodule
!==MyModule
)