English 中文(简体)
Can Firebase s GeoFire be downloaded via Swift Package Manager?
原标题:

Can Firebase s GeoFire be downloaded via Swift Package Manager?

I read a comment here that it can be if Firebase is installed under the main branch instead of a version rule, but the Firebase docs only mention installing via CocoaPods.

Also, if it is possible this way, isn t it still recommended that Firebase is installed under a version rule and not the main branch?

My main concern is that I have Firebase fully integrated in my project via SPM, but now I want to add the GeoFire product. If GeoFire must be installed with CocoaPods, do I have to completely uninstall Firebase from SPM and reinstall it as a cocoa pod, or can I leave it with both...

问题回答

This is what I did and it worked for me:

  1. I downloaded GeoFire/Objective-C from github https://github.com/firebase/geofire-objc

  2. Unzipped the library and copied the contents of the API, Implementation and Utils folders into corresponding folders I created in my SwiftUI project. The result was something like this: GeoFireObjcFiles API h GeoFire h GFCircleQuery h GFQuery h GFRegionQuery Implementation h GFQuery+Private m GFQuery h GeoFire+Private m GeoFire Utils h GFBase32Utils m GFBase32Utils h GFGeoHash m GFUtils h GFUtils m GFGeoQueryBounds h GFGeoQueryBounds m GfGeoHashQuery h GFGeoHashQuery m GFGeoHash

  3. I created a Bridging Header and #import ed all the objective-C .h files into it See CallObjectiveCFromSwift

  4. I made sure the .m files are added to BuildPhases->CompileSources list

And that was it. I built and everything was fine.





相关问题
SwiftUI: How do I position a button x points above a sheet?

I am trying to recreate a Maps-style UI with a persistent bottom sheet and controls fixed above. Apple Maps UI with controls above ☝️ Example here, the "Look Around" binoculars button and ...

BraintreeDropIn deprecated functions error

I m getting this error on the latest release of BraintreeDropIn, I really don t get it since based on the patch notes, this should ve been addressed already, I have already tried cleaning derived data,...

how to limit zoom level in map swift ui?

how to limit zoom level in map swift ui i have map and need to make zoom level limited Map(coordinateRegion: $region,annotationItems: viewModel.nearbyGyms) { item in ...

UIImageView - How to get the file name of the image assigned?

Is it possible to read the name of an UIImageView s UIImage that s presently stored in the UIImageView? I was hoping you could do something kind of like this, but haven t figured it out. NSString *...

热门标签