简体   繁体   中英

Installing third party Objective-C library within Swift 3 / Xcode 8 (SharkORM)

Im pretty new to Xcode/Swift and want to install a third party library(SharkORM).

I drag'n'dropped the folder "SharkORM" into XCode and selected "Create groups". Then i created a file "Swift-Bridging-Header.h" and typed in #include “SharkORM.h” as described in the documentation . When i hold CMD and click on it it leads me to the interface declaration(good!?). Now when i try to use it: class MyClass: SRKObject { ... } i get an error: "Use of undeclared type 'SRKObject'". But i can CMD+click on it which leads me to the interface declaration again.

I tried to install with Cocoapod, too, with no success.

As posted on GitHub, it sounds like the header file you created has not been added to the build settings as the chosen bridging header.

That is the most likely scenario leading to the object not being defined in your swift code.

Check, if SharkORM.h contains SRKObject declaration. If not, find header file with it and place it to bridging header too

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