tec*_*erd 7 iphone frameworks ios swift swift4
我创建了一个名为 的框架Communication
,框架容器内有一个module.modulemap
文件。
模块.modulemap
framework module Communication {
umbrella header "Communication.h"
export *
module * { export * }
}
Run Code Online (Sandbox Code Playgroud)
我可以理解该模块需要伞头将其暴露给包含应用程序/目标。
但是其他两行代码的含义是什么。
export *
module * { export * }
Run Code Online (Sandbox Code Playgroud)
如果有人知道这条线出口的是什么?
Objective-C 和 Swift 的 Objective-C 模块映射(.modulemap)
Objective-C 语言通过 Objective-C 和 Swift 语言的 .modulemap 公开 API
它是关于LLVM 模块和模块映射语言。Modulemap
公开外部二进制文件的C 头文件。它是模块和标头之间的桥梁。Modulemap 有助于转换,因为它内部有模块名称和标头之间的映射。modulemap 还有助于创建独立的附加模块和子模块。Modulemap可以包含很多模块(只有一个模块必须与产品名称相同)和很多子模块#include, #import -> @import
//Objective-C exposes API through .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
Run Code Online (Sandbox Code Playgroud)
其中包含的框架.modulemap
称为Modular Framework
. 小路:
//Objective-C exposes API through .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
Run Code Online (Sandbox Code Playgroud)
设置
即使你创建了 Swift 框架,Xcode 也会自动创建 modulemap
[在同一应用程序中混合 Objective-C 和 Swift]
归档时间: |
|
查看次数: |
3549 次 |
最近记录: |