10

And then it could be linked and used from Objective-C with the

@import MyStaticLib;

syntax.

If so, how, exactly, do you do this.

Clay Bridges
  • 10,746
  • 10
  • 62
  • 110

3 Answers3

0

You can create a static library with .modulemap file to use @import syntax

Read more here

yoAlex5
  • 13,571
  • 5
  • 105
  • 98
-1

If you can edit the library Xcode project you can create a *.modulemap file and set it to the MODULEMAP_FILE Build Setting.

Sample map file from CocoaLumberjack:

framework module CocoaLumberjack {
    umbrella header "CocoaLumberjack.h"

    export *
    module * { export * }
}

module CocoaLumberjack.DDContextFilterLogFormatter {
    header "DDContextFilterLogFormatter.h"
    export *
}

module CocoaLumberjack.DDDispatchQueueLogFormatter {
    header "DDDispatchQueueLogFormatter.h"
    export *
}

module CocoaLumberjack.DDMultiFormatter {
    header "DDMultiFormatter.h"
    export *
}

module CocoaLumberjack.DDASLLogCapture {
    header "DDASLLogCapture.h"
    export *
}

module CocoaLumberjack.DDAbstractDatabaseLogger {
    header "DDAbstractDatabaseLogger.h"
    export *
}
Rivera
  • 10,182
  • 3
  • 49
  • 96
-1

You can by creating a framework from this static library, you can follow all the instructions here

Once finished, you can import your static library like that:

@import MyStaticLib;
Loegic
  • 3,160
  • 18
  • 32