Swiftfin icon indicating copy to clipboard operation
Swiftfin copied to clipboard

Replace or work on Stinsen

Open LePips opened this issue 10 months ago • 4 comments

Stinsen is the great coordinator package we have used for view coordination for a while. However, it hasn't seen active development for a long time and I will soon be incorporating some design elements that the package can't handle (eg: dynamic tabs). I have personally contributed to the project and even have merge permissions, but it's a somewhat large project to refactor. Also, it doesn't support the split column view for iPadOS which is why iPadOS has a tab bar instead.

We need to replace or work heavily on Stinsen so that we can support more design features. I would still heavily, heavily want to be using the coordinator behavior. Looking up swiftui coordinator on GitHub there are a few other packages to investigate.

LePips avatar Apr 19 '24 05:04 LePips

Was there a reason for the coordinator pattern originally? Or is there a statistic of how many people use the app with iOS 15? We could modernize with a more native approach (NavigationStack iOS 16+) and like Azam Sharp explained here. It kinda follows the coordinator syntax in my opinion and already had great success in my own apps (smaller apps) and at work (bigger app).

Just a suggestion and would love to hear your opinion on that!

bennyyy999 avatar May 02 '24 15:05 bennyyy999

I just like the coordinator pattern and it makes navigation really easy, nothing more. On an opinionated note, I never really liked NavigationLink and personally find it baffling that there isn't a coordinator equivalent by Apple in SwiftUI.

There wasn't an iOS version restriction per say and whatever solution we use could utilize some back-ported NavigationStack APIs for version compatibility. Thank you for sharing that article as I haven't seen it before and am taking it into consideration.

I may take a look at making my own solution, especially since I want to see if I can utilize Transmission for some custom transitions and I haven't seen a package (on first glance) that would allow the full customization I want with tabs.

LePips avatar May 02 '24 17:05 LePips

As far as I can tell, PresentationDetents and Apple's new zoom navigation in iOS 18 can accomplish much of what Transmission offers in terms of navigation handling/animations.

Also the article that Bennyyy shared is a pretty popular one. I've seen it circulate many social channels including being featured in the iOS Dev Weekly newsletter. I'm still fairly unseasoned when it comes to the coordinator/routes pattern but what the article proposes seems decent. Trying to stay as vanilla as possible is likely the best approach right now given how much of SwiftUI is still in flux (NavigationStack at iOS 16, toolbar changes in iOS 17, Tab changes in iOS 18).

chickdan avatar Oct 15 '24 01:10 chickdan

The new zoom navigation fulfills my desire for what I wanted with custom transitions and I was excited to see that. I have some loose-ideas of other presentation transitions but those are in the sandbox for now. I did like the shared article a lot as well and have also had community members share similar implementations.

I've gone through a few phases with Stinsen where I wanted each "screen" to have its own coordinator so it "only cares about the other screens it can present to" but then the mass of coordinators became too much boilerplate for every screen, which is why I've allowed something like SettingsCoordinator to bloat up. I'm sure this is a common route people take with coordinators.

Over the years of my SwiftUI experience I've too learned to be at the whim of Apple, even if they won't implement desired APIs until future iOSs. Regarding a timeline, I've wanted to drop iOS 15 by now but I will want to have my most recent video player refactor work in that, just to help people a little bit before we drop them. The latest date that I have come up with is the end of this year, regardless of feature completeness (within rationality).

LePips avatar Oct 15 '24 18:10 LePips