I have written a library in Swift and I wasn\'t able to import it to my current project, written in Objective-C.
Are there any ways to import it?
#i
Importing Swift
file inside Objective-c
can cause this error, if it doesn't import
properly.
NOTE: You don't have to import Swift files externally, you just have to import one file which takes care of swift files.
When you Created/Copied Swift file inside Objective-C project. It would've created a bridging header automatically.
Check Objective-C Generated Interface Header Name
at Targets -> Build Settings
.
Based on above, I will import KJExpandable-Swift.h
as it is.
Your's will be TargetName-Swift.h
, Where TargetName
differs based on your project name or another target your might have added and running on it.
As below my target is KJExpandable
, so it's KJExpandable-Swift.h