JamesSedlacek / Routing

SwiftUI library for abstracting navigation logic from views

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not support on iOS 16.0

ankitpanchotiya99138 opened this issue · comments

As per the documentation Routing support iOS 16.0 version as well but after new update it's not.

It supports iOS 16.0

You just need to make a Router that conforms to RoutableObject & uses the ObservableObject protocol + @Published properties instead of the @Observable macro.

public final class Router<Routes: Routable>: RoutableObject, ObservableObject {
    public typealias Destination = Routes

    @Published public var stack: [Routes] = []

    public init() {}
}

Something like this