XCoordinator icon indicating copy to clipboard operation
XCoordinator copied to clipboard

macOS support

Open saket opened this issue 4 years ago • 8 comments

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!

saket avatar Jan 17 '22 03:01 saket

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.

pauljohanneskraft avatar Mar 29 '22 17:03 pauljohanneskraft

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.

andrefmsilva avatar Mar 29 '22 18:03 andrefmsilva

https://streamable.com/o7uwnn

andrefmsilva avatar Mar 29 '22 18:03 andrefmsilva

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?

pauljohanneskraft avatar Mar 29 '22 19:03 pauljohanneskraft

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

andrefmsilva avatar Mar 29 '22 20:03 andrefmsilva

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

andrefmsilva avatar Mar 29 '22 20:03 andrefmsilva

@pauljohanneskraft News about this one?

andrefmsilva avatar Sep 13 '22 12:09 andrefmsilva

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

pauljohanneskraft avatar Sep 13 '22 12:09 pauljohanneskraft