简体   繁体   中英

Bridging Objective-C into Swift Project

I'm trying to put a bridging header file into my Swift project so I can use the Venmo SDK. I've placed the header file where I believe it should go and have added it to the Swift Complier - Code Generation section under build settings.

The bridging header is titled BridgingHeader.h and is directly under the project subsection (would post photo but I don't have enough reputation). It's in the same location as this link:

在此处输入图片说明

Under the swift compiler - code generation my path to the bridging header is BridgingHeader.h. Initially I tried to reference the file from the root directory but I still had an error saying error:

bridging header '/Users/j9/Desktop/uSell-swift/BridgingHeader.h' does not exist

Apparently, the compiler is looking for .../BridgingHeader.h, while the actual name is LearnSwift-Bridging-Header.h.

By the way, you can avoid these annoyances by adding an ObjC class File->New->Source->Objective C file ... It will create and configure the header for you.

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