Closed joshkopecek closed 3 years ago
Hi, is it also allowed to add Package.swift files to purely objective-c codebases? I don't have any experience with this, however I'd be more than happy to accept a PR that adds this file!
I tried adding the Package.swift file, but there are some issues. It doesn't like the mixed swift/objc in the Tests, and I can't seem to add the UIKit framework as a dependency in objc.
I created a fork here: https://github.com/joshkopecek/posthog-ios/tree/features/spm
Hi @joshkopecek , just checking in, did you get posthog-ios
working with a Package.swift file in the end... or how are you currently integrating it into your app? We'd love to make setup really easy for all iOS developers. We should probably update the docs to guide swift users better with the current way of installing it...
Currently using Cocoapods to install, although Package.swift would be preferred. I did some rudimentary work on it, and looked like it would be possible, but I ran out of time. It's in my repo as mentioned above.
As I mentioned above I was struggling to get it to see the core iOS UIKit framework. It might be good to remove that anyway.
Any progress on this? Had a call with the team today and SPM support would really make integration simpler for us. As for the UIKit import and can simply wrap anything that uses UIKit in conditional checks a la https://www.hackingwithswift.com/example-code/language/how-to-check-whether-a-module-is-available-using-canimport
I'd love it if someone with enough experience with ObjC/Swift dependencies could pick this up!
PR #10 and version 1.2.2
could have fixed this.
It would be great to have a Package.swift file for PostHog, so it could be easily installed.