How to import Swift code into Objective-C Module or Framework?

  • Import Swift files into the module you want.
  • Modify all swift declarations of classes, properties or methods you want to use in your module with @objc public in front of each declaration. Whereas classes don’t need @objc, just put public in front of it would be OK.
  • And for the left, do as what apple said here.

OK, there you go now 🙂

XCode Framework Issues

Image not found - runtime

Under framework settings of the target, set Embed as Embed and Sign or Embed without Sign

Can't build module or
Umbrella header doesn't include xxx header or 
xxx header must be imported from module xxx before it is required

Check this framework’s dependencies (e.g. Check pod file to get the dependency list if you use Cocoapods), make sure they are OK under your current project environment.

Can't find xxx header

Check your framework/header searching path.