I need to mix Swift and Objective-C code inside a static library in iOS. I have created module.modulemap
file and included the Private
module there. I can also import the private module without any error message, but still the compiler throws an error when I try to reference the private class with Use of unresolved identifier 'PrivateClass'
UsePrivateClass.swift
import Foundation
import StaticLib.Private
class UsePrivateClass {
func printPublicClass() {
PublicClass().print()
}
func printPrivateClass() {
PrivateClass().print()
}
}
module.modulemap
module StaticLib {
export *
explicit module Private {
header "PrivateClass.h"
}
}
I have already set DEFINE_MODULES
to YES
and MODULEMAP_FILE
to the module.modulemap
file. Probably missing something related to copying the modulemap file to the right destination or PrivateClass.h
header file, but not sure what step is missing.
Created a sample project here.
Aucun commentaire:
Enregistrer un commentaire