From 6708e9e6d18a9b6d003da0994f5a367e13cb940a Mon Sep 17 00:00:00 2001 From: Jimmy S Date: Fri, 8 Apr 2022 19:43:07 +0530 Subject: [PATCH] Allow accessing stack from UIPilot --- Sources/UIPilot/UIPilot.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/UIPilot/UIPilot.swift b/Sources/UIPilot/UIPilot.swift index 894255f..4582f4e 100644 --- a/Sources/UIPilot/UIPilot.swift +++ b/Sources/UIPilot/UIPilot.swift @@ -14,6 +14,10 @@ public class UIPilot: ObservableObject { let logger: Logger var state: UIPilotViewState! + public var stack: [T] { + return paths.map { $0.route } + } + public init(initial: T, debug: Bool = false) { logger = debug ? DebugLog() : EmptyLog() logger.log("UIPilot - Pilot Initialized.")