RSSAmplifier

technicat.com · Oct 15, 2023

A SwiftUI Router

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

One update I made to Talk Dim Sum this year was to add a custom router so I can escape the NavigationLink straightjacket. My router is just a simple stack. @ Observable public class Router < T : Equatable > { public var path : [ T ] = [] public init () { } public func push ( _ route : T ) { path . append ( route ) } public func pushNew ( _ route : T ) { if path . last != route { push ( route ) } }…

Read on /blog/programming/swift/route/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.