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) andTargetB
(ObjC) - I'd like to make the
ProtocolTarget
implicitly imported, so that when theTargetB
importsTargetA
, all of the methods from theProtocolTarget
should become also available inside theTargetA
.
How can I achieve this?