@_exported import but in Objective-C

Viewed 53

Swift has an interesting keyword, which can be declared in the ModuleA:

@_exported import Foundation

Then, when in some other module (e.g. ModuleB) I import the ModuleA:

import ModuleA

let currentDate = Date() // using a Foundation struct

... I'm able to use also the types from the Foundation even though I'm not importing it with an import statement. It's being automatically imported as it has been declared as @_exported in the ModuleA.

Now I'd like to have a similar behavior in Objective-C.

Given:

  • 3 Targets: TargetA (Swift), ProtocolTarget(Swift with @objc keyword annotated types) and TargetB (ObjC)
  • I'd like to make the ProtocolTarget implicitly imported, so that when the TargetB imports TargetA, all of the methods from the ProtocolTarget should become also available inside the TargetA.

How can I achieve this?

0 Answers
Related