rundfunk47 / stinsen

Coordinators in SwiftUI. Simple, powerful and elegant.
MIT License
907 stars 95 forks source link

SwiftUI 4 NavigationStack naming conflict #76

Open razvanrujoiu opened 2 years ago

razvanrujoiu commented 2 years ago

I'm usingMacOS Ventura Beta with SwiftUI 4. The problem is that Apple introduced NavigationStack in SwiftUI 4 and it conflicts with the NavigationStack<T: NavigationCoordinatable> from stinsen library. Hence i'm getting the following error: Generic type 'NavigationStack' specialized with too few type parameters (got 1, but expected 2) As a quick fix i think you could rename NavigationStack to SNavigationStack or StinsenNavigationStack

LePips commented 2 years ago

This is simply fixed in https://github.com/rundfunk47/stinsen/pull/75

rundfunk47 commented 2 years ago

As @LePips says, this is temporary fixed with a namespace. However, this item should still be open - a long term solution should be to rename it completely. Any suggestions? I'm not a huge fan of adding a "Stinsen"-prefix...

Maybe just Stack would be fine?

LePips commented 2 years ago

I think Stack would be problematic both in usage and in context. It would conflict with a basic Stack if a developer ever had one since NavigationStack is already public. For context, it's usually better to have the name indicate its domain or purpose, especially since it's for navigation.

razvanrujoiu commented 2 years ago

I totally agree with @LePips , naming it just Stack would certainly create confusion

LePips commented 2 years ago

With the release of Xcode 14 at time of writing, this is become an immediate "issue". I'm not bothered too much by my single usage of Stinsen.NavigationStack but something should be decided.

@rundfunk47 Have you been able to work on anything in regards to the latest comment in https://github.com/rundfunk47/stinsen/issues/29? If not, that's completely fine.

LePips commented 2 years ago

A more pressing issue is that the navigation title styles (.inline, .large) are no longer consistent on push with Stinsen when targeting iOS 16. They will default to .large.