kreeger / BDKCollectionIndexView

Gives a UICollectionView the sectionIndexTitles scrub bar that a UITableView gets for almost free.
MIT License
158 stars 29 forks source link

Swift Package Manager support #37

Open madhikarma opened 2 years ago

madhikarma commented 2 years ago

Hi there 👋

We're using this component in our app but the iOS team are moving towards just using Swift Package Manager for managing dependencies.

So I've added a Package.swift file to this library via the initialisation steps and kept the same iOS support as the CocoaPod spec file and updated the README file.

Note. since it's Objective-C I've needed to mention where the public header files can be found in the Package.swift file and I had change the folder structure to remove the Demo project for some reason it produced module not found errors

I've tested integration here in a demo project https://github.com/madhikarma/BDKCollectionIndexViewSPMDemo and everything appears to be working.

Please take a look when you can and let me know what you think.

Thank you in advance

kreeger commented 2 years ago

Thanks a ton for this, @madhikarma! I'll take a look hopefully today or tomorrow.

madhikarma commented 2 years ago

@madhikarma By moving the files around for SwiftPM support, you've broken CocoaPods support. Can you fix the .podspec so that it references the new paths?

Hi @kreeger sorry, I realised this after I authored the PR but looks like I forgot to add it to the PR description.

I will fix the Pod spec with the new path and test that the library can still be installed via CocoaPods as well as Swift Package Manager.

Q. Is there any other Pods related admin I need to do e.g. version bump? Pushing spec to the pods repo or is it just the path I need to change? (it's been a while since I authored a Pod)

Thank you for the other bits of code review / things to tidy up too

ETA: maybe sometime over this weekend

kreeger commented 2 years ago

There's no need for you to do any version bumping or pushing to the spec repo! I can take care of that once this PR makes it in.