简体   繁体   中英

Xcode/Swift: How to import a framework without actually including 'import xxx' in file

I've been following a Firebase tutorial for Swift here .

In the project I don't see any explicit 'import FirebaseXXX' within any of the files and was curious how this was being done.

I'm trying to get the same behavior in project but haven't had much luck yet. I have the same Bridging Header in my project, I've tried building/cleaning my project, and I've done 'pod update' and 'pod install' after adding the different pods to my Podfile.

So how exactly is this being done?

Thanks!

If you look at the bridging header ( Grocr-Bridging-Header.h ), they import the framework there

#import <Firebase/Firebase.h>

Objective-C #imports that happen in the bridging header are global across swift files in the project.

If you are using the swift framework, you'll need to import Firebase at the top of the files to use the framework.

Also see Cannot import Firebase in Swift app

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