QuickBirdEng/XCoordinator

macOS support

saket opened this issue · 8 comments

saket commented

Hey folks, XCoordinator looks great. Is there any possibility of adding support for macOS? Considering that you're planning to add support for watchOS, it'd be nice to cover the desktop as well!

Hello - this is a great idea - thank you for telling us. The problem with this is, that UIKit and AppKit use fundamentally different types (NSViewController vs UIViewController for example), which would require pretty much a rewrite.
Since watchOS is very similar to iOS, the addition of that platform requires significantly less work.
Especially with macCatalyst and Apple Silicon available now, you should however already be able to use XCoordinator on Mac.
Let me know, if you would want to help with the implementation (regarding AppKit), since it would definitely be a great addition to this library.

I did a quick test using the sample app and it compiles for macCatalyst just fine (ofc we need to enable mac in XCoordinator Package.swift).
The UI has some problems but i can push and pop controllers.

The example app has (unfortunately) not even been optimized for iPad, that's why these issues are there. They should not be connected to XCoordinator directly though.

I can't seem to be able to build the example app for Mac Catalyst though on my M1 Mac - RxCocoa seems to be unavailable on this platform for some reason - do you have an idea why that is?

I'll do everything again with the latest commits to find the correct steps

This are the steps that i did to make it work.

1 - Removed the reference of XCoordinator package from the sample project and i've added a reference for a local copy of the repo
2 - Add .macOS(.v10_14) to platforms in my XCoordinator local package
3 - Increase the version of RxSwift in the sample to 6.0.0 - Next Major
4 - Add the reference to XCoordinator and XCoordinatorRx in Frameworks
5 - Enable the Mac Catalyst checkbox with Optimize for Mac

@pauljohanneskraft News about this one?

@andrefmsilva no, sorry - would you be willing to create a pull request with these changes?