Skip to content

Package.swift file #1

Closed
Closed

Description

@joshkopecek

It would be great to have a Package.swift file for PostHog, so it could be easily installed.

Activity

  1. mariusandra commented on May 18, 2020

    @mariusandra
    Contributor

    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!

  2. joshkopecek commented on May 19, 2020

    @joshkopecek
    Author

    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

  3. mariusandra commented on May 29, 2020

    @mariusandra
    Contributor

    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...

  4. joshkopecek commented on Jun 1, 2020

    @joshkopecek
    Author

    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.

  5. dannyhertz commented on Jul 22, 2020

    @dannyhertz

    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

  6. mariusandra commented on Aug 3, 2020

    @mariusandra
    Contributor

    I'd love it if someone with enough experience with ObjC/Swift dependencies could pick this up!

  7. mariusandra commented on Feb 22, 2021

    @mariusandra
    Contributor

    PR #10 and version 1.2.2 could have fixed this.

  8. added 2 commits that reference this issue on Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions