arnauddorgans / InfiniteLayout

Horizontal and Vertical infinite scrolling feature for UICollectionView with Paging, NSProxy delegate, Reactive extension, SectionModel & AnimatableSectionModel support
MIT License
517 stars 63 forks source link

Updated Package.swift definition to optionally include Rx related classes and extensions. #15

Closed cdann-leafly closed 4 years ago

cdann-leafly commented 4 years ago

The Sources/Rx folder was not previously included in the Package.swift definition, which made it impossible to import InfiniteLayout through SPM with the additional Rx related classes and extensions.

I didn't want to create an explicit dependency requirement on RxSwift and RxDataSources, so I included the Rx source files in the InfiniteLayout target and then added conditional compilation directives to only compile them if RxSwift/RxDataSources are available in the project.

This allows you to import InfiniteLayout through SPM without requiring RxSwift. If RxSwift is available, the Rx related extension for InfiniteLayout also become available.

cdann-leafly commented 4 years ago

Apologies, this didn't end up working quite the way I expected. Looking into other options and will open another PR when I have a solution.