I have created one framework named Communication
, inside framework container there is one module.modulemap
file.
module.modulemap
framework module Communication {
umbrella header "Communication.h"
export *
module * { export * }
}
I can understand that module required umbrella header to expose it to containing application/target.
But what is meaning of other two lines of code.
export *
module * { export * }
If any have idea what this lines exporting ?
Modulemap exposes C header files for external binaries. It is a bridge between module and headers. Modulemap helps to convert #include, #import -> @import because it has a mapping between module name and headers inside. Also modulemap helps to create standalone additional modules and submodules.
Module: A set of parts that can be assembled into a structure. To Xcode, that means you can have a group of lines of code that you can (re)use in different places without having to write that code again.
The umbrella header is the 'master' header file for a framework. Its use is that you can write #import <UIKit/UIKit.h>
Objective-C Module Map(.modulemap) for Objective-C and Swift
Objective-C language exposes API thought .modulemap for Objective-C and Swift languages
[ObjC Module]
[Custom .modulemap]
It is about LLVM Modules and Module Map Language. Modulemap
exposes C header files for external binaries. It is a bridge between module and headers. Modulemap helps to convert #include, #import -> @import
because it has a mapping between module name and headers inside. Also modulemap helps to create standalone additional modules and submodules. Modulemap can contains a lot of modules(only one has to have the same name as product name) and a lot of submodules
//Objective-C exposes API thought .modulemap for Objective-C and Swift
.h.m uses .h.m = Objective-C consumer, Objective-C producer = .modulemap
.swift uses .h.m = Swift consumer, Objective-C producer = .modulemap
Framework which includes .modulemap
is called Modular Framework
. Path:
module_name.framework/Modules/module_name.modulemap
Setup
Even if you create Swift framework Xcode automatically creates modulemap
[Mixing Objective-C and Swift in the same Application]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With