In Swift, how to import a target with dash in its name?

前端 未结 1 1855
予麋鹿
予麋鹿 2021-02-04 02:51

This might be something very basic yet I just can\'t find the answer...

Say I have two targets in my Xcode project: foo-bar and foo-barTests

now if I want to mak

1条回答
  •  情歌与酒
    2021-02-04 03:17

    Okay it was very basic:

    Naming Your Product Module

    The name of the Xcode-generated header for Swift code, and the name of the Objective-C bridging header that Xcode creates for you, are generated from your product module name. By default, your product module name is the same as your product name. However, if your product name has any non-alphanumeric characters, such as a period (.), they are replaced with an underscore (_) in your product module name. If the name begins with a number, the first number is replaced with an underscore.

    You can also provide a custom name for the product module name, and Xcode will use this when naming the bridging and generated headers. To do this, change the Product Module Name build setting.

    so import foo-bar becomes import foo_bar .

    0 讨论(0)
提交回复
热议问题