简体   繁体   中英

Linking swift files for Interoperability with Objective C applications in iOS

In a project named BridgingSwiftAndObjC, the App's target settings displays, under the Swift Compiler - General, under the Objective-C Bridging Header arrow, the setting states the Objective-C Bridging Header file explicitly.

在此处输入图片说明

If the Objective-C Bridging Header is automatically generated when a swift file is created in an objective c app; does that mean the name of the file has to be the name of the app?

Can an Objective-C Bridging Header be manually created and linked by editing the name of the attribute under the target settings or must further steps be taken in order to successfully start bridging?

It appeared that the Objective C Generated Header Name attribute in the project's target settings is the place that points to the explicit name of the correct file to import when bridging Swift into Objectiive C Applications.

In my case, the correct file to import was

#import "Name_Of_My_Xcode_App-Swift.h"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM