Skip to content

Commit fb06e53

Browse files
Sadmansameematteopuc
authored andcommitted
Rename NavigationStack to NavigationStackCompat.
1 parent 9a77a4a commit fb06e53

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Sources/NavigationStack/NavigationStack.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum NavigationType {
1717

1818
Also, it can be created outside of a `NavigationStackView` hierarchy and injected manually into it during the `NavigationStackView` initialization process.
1919
*/
20-
public class NavigationStack: ObservableObject {
20+
public class NavigationStackCompat: ObservableObject {
2121

2222
/// The default easing function for push and pop transitions.
2323
/// - Tag: defaultEasing

Sources/NavigationStack/NavigationStackView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public enum NavigationTransition {
3030
}
3131

3232
/// An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation.
33+
///
3334
public struct NavigationStackView<Root>: View where Root: View {
34-
@ObservedObject private var navigationStack: NavigationStack
35+
@ObservedObject private var navigationStack: NavigationStackCompat
3536
private let rootView: Root
3637
private let transitions: (push: AnyTransition, pop: AnyTransition)
3738

@@ -41,11 +42,11 @@ public struct NavigationStackView<Root>: View where Root: View {
4142
/// - easing: The easing function to apply to every push and pop operation.
4243
/// - rootView: The very first view in the NavigationStack.
4344
public init(transitionType: NavigationTransition = .default,
44-
easing: Animation = NavigationStack.defaultEasing,
45+
easing: Animation = NavigationStackCompat.defaultEasing,
4546
@ViewBuilder rootView: () -> Root) {
4647

4748
self.init(transitionType: transitionType,
48-
navigationStack: NavigationStack(easing: easing),
49+
navigationStack: NavigationStackCompat(easing: easing),
4950
rootView: rootView)
5051
}
5152

@@ -55,7 +56,7 @@ public struct NavigationStackView<Root>: View where Root: View {
5556
/// - navigationStack: the shared NavigationStack
5657
/// - rootView: The very first view in the NavigationStack.
5758
public init(transitionType: NavigationTransition = .default,
58-
navigationStack: NavigationStack,
59+
navigationStack: NavigationStackCompat,
5960
@ViewBuilder rootView: () -> Root) {
6061

6162
self.rootView = rootView()

Sources/NavigationStack/Pop.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public enum PopDestination {
2121

2222
/// A view used to navigate back to a previous view through its enclosing NavigationStack.
2323
public struct PopView<Label, Tag>: View where Label: View, Tag: Hashable {
24-
@EnvironmentObject private var navigationStack: NavigationStack
24+
@EnvironmentObject private var navigationStack: NavigationStackCompat
2525
private let label: Label
2626
private let destination: PopDestination
2727
private let tag: Tag?

Sources/NavigationStack/Push.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SwiftUI
99

1010
/// A view used to navigate to another view through its enclosing NavigationStack.
1111
public struct PushView<Label, Destination, Tag>: View where Label: View, Destination: View, Tag: Hashable {
12-
@EnvironmentObject private var navigationStack: NavigationStack
12+
@EnvironmentObject private var navigationStack: NavigationStackCompat
1313
private let label: Label?
1414
private let destinationId: String?
1515
private let destination: Destination

0 commit comments

Comments
 (0)