Swift @import of the module '<module name>' in the implementation <Project name>; use #import

I am trying to create a mixed ObjC-Swift infrastructure. But I am losing a lot of hair trying to create a private module for my Swift files.

I followed a few steps in iOS with a mixed dynamic structure - the objc bridge headers with a private module in combination with some steps in https://stackoverflow.com/a/4646/

Basically, now I have module.modulemap, which has the following content:

module MyCore {    //Adding 'framework' before module is giving me an "Umbrella not found"-error :/
umbrella header "MyCore.h"

export *
module * { export * }

explicit module MyCorePrivate {
    header "MyCore_PrivateUmbrella.h"
    export *
}

}

MyCore_PrivateUmbrella.h , Swift. , 1 , ( ...).

:

  • DEFINES_MODULE: YES
  • PRODUCT_MODULE_NAME: MyCore
  • CLANG_ENABLE_MODULES:
  • SWIFT_OBJC_INTERFACE_HEADER_NAME: MyCore-Swift.h
  • SWIFT_INCLUDE_PATHS: module.modulemap

, ; ALWAYS_SEARCH_USER_PATHS NO

Swift , import MyCore.MyCorePrivate. , Objective-C.
​​ ( ):

what is this mistake?

MyCore-Swift.h, @import MyCore.MyCorePrivate .

, , , . , , XCode.

- , ?

+4
1

:

1) . .

2) , , , , . ( < >

3) swift to objc .

4)

5) (, MyFramework.framework)

6) ( Myframework.h)

7) ,

8) .h , ( )

9) .module

:

framework module MyFramework { 
umbrella header "MyFramework.h" export * module * {export *}}
+1

All Articles