I have objective c static library and I have used it inside the swift framework but when I distribute swift framework to users they are able to access my static library classes directly. so how would I stop the direct access of static lib classes to framework users?
moduleMap file code - ProjectName.modulemap
framework module {
umbrella header "ProjectName.h"
export *
module * { export * }
explicit module ProjectName_Private {
private header “<headerName>.h”
link “staticLibName” // external static Library
export *
}
}
Build settings
- Set header search path - ${SRCROOT}/
- Set library search path - $(inherited) $(PROJECT_DIR)/
- Module map file - /
- Import path - $(inherited) $(PROJECT_DIR)/
- Build Library for distribution - yes
SDGGiesbrecht
(Jeremy David Giesbrecht)
2
It isn’t officially possible yet because the design isn’t finalized, but you can try out @_implementationOnly at your own risk. Here is an example in SwiftSyntax’ source code.
thanks for the reply, will try to implement.