What does the “Embedded Content Contains Swift Code” build setting in Xcode 6 do?

后端 未结 3 473
迷失自我
迷失自我 2020-12-17 07:55

It\'s a new setting under \"Build Options\". What does it do? I can\'t seem to find any documentation about it. My guess is this: Does it have to be set to YES

3条回答
  •  春和景丽
    2020-12-17 08:17

    According to Embedding Content with Swift in Objective-C

    Swift standard libraries are copied into a bundle if and only if you are building an application and this application contains Swift source files by itself

    If you are building an app that does not use Swift but embeds content such as a framework that does, Xcode will not include these libraries in your app. As a result, your app will crash upon launching

    To workaround this issue, set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES

提交回复
热议问题