We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2465f5 commit 9a77a4aCopy full SHA for 9a77a4a
Sources/NavigationStack/NavigationStack.swift
@@ -45,6 +45,13 @@ public class NavigationStack: ObservableObject {
45
viewStack.depth
46
}
47
48
+ /// Returns a Boolean value indicating whether the stack contains a view with the specified ID.
49
+ /// - Parameter id: The ID of the view to look for.
50
+ /// - Returns: **true** if the stack contains a view with the specified ID; otherwise, **false**.
51
+ public func containsView(withId id: String) -> Bool {
52
+ viewStack.indexForView(withId: id) != nil
53
+ }
54
+
55
/// Navigates to a view.
56
/// - Parameters:
57
/// - element: The destination view.
0 commit comments