delba / Permission

A unified API to ask for permissions on iOS
MIT License
2.9k stars 320 forks source link

Support Swift Package Manager #147

Open mtfum opened 4 years ago

mtfum commented 4 years ago

Thank you for your great OSS!

This PR is about SPM, Although as I mentioned at https://github.com/delba/Permission/issues/146! I tried to create Package.swift.

SixFiveSoftware commented 4 years ago

+1 for this! Might be worth adding a sentence or two in the README about the added SPM support in this PR. Came here wanting to make my own PR and saw there already was one 😄

mtfum commented 4 years ago

Thanks for the response! @SixFiveSoftware

But this PR doesn't work sadly. This is because Permission must provide custom build flags before building (#configuration).

To deal with the problem, in case of Cocoapods, use subspecs, and in case of Carthage, use xcconfig

I don't have the idea to do this correspondence in SPM.

If anyone has any advice, please let me know.

SixFiveSoftware commented 4 years ago

@mtfum , correct, I had actually tried to pull from your branch using SPM the other day and found that out too. I experimented with a few things, but you're right, the subspec behavior is difficult to mimic via SPM (at least with my limited knowledge of it). I reverted back to CocoaPods after a bit of trying.