QuickBirdEng / XCoordinator-Example

XCoordinator-Example serves as an MVVM-C example app for XCoordinator
https://github.com/quickbirdstudios/XCoordinator
MIT License
65 stars 14 forks source link

Example for Combine #8

Open Rion-Kaneshiro opened 4 years ago

Rion-Kaneshiro commented 4 years ago

Is it planned to make the example using Combine instead of RxSwift?

Man it sounds like I‘m an opponent of RxSwift xD

pauljohanneskraft commented 4 years ago

It would definitely be great to provide an example app with Combine instead of RxSwift.

However, due to time constraints, I cannot really work on it at the moment - feel free to open a MR yourself though! 😊

Rion-Kaneshiro commented 4 years ago

Do you have any preference how this should be structured?

Adding canImport everywhere could be confusing.

Maybe splitting the project into two targets and having a shared code base.

As far as I see it right now the Model and the Impl files are effected by this since AnyObserver<Void> needs to be replaced by PassthroughSubject<Void, Never> to get the send(_:) functionality. Of cause some ViewControllers also need some different behavior since there are no bindings in Combine (could be solved by using CombineCocoa).

pauljohanneskraft commented 4 years ago

I'm not quite sure, whether mixing the two makes much sense, since it might overcomplicate things... A shared code base with different targets is also somewhat difficult since it would require too many changes or unfamiliar code (i.e. typealias instead of actual name or separate files altogether without much actually shared code). I would suggest doing the Combine version on a special branch and then cross-referencing the Combine and master branch.

Rion-Kaneshiro commented 4 years ago

Finished the rewrite. Can you create a branch for it and merge the MR #9? Linking this issue would be great, too :)

It's more or less a direct translation from one Framework to the other and certainly could be more "Combinely" (if thats a word). I'll see how I can improve it in the coming days :)