NavigationView

public struct NavigationView : View

A view that provides navigation functionalities.

Important

This is a Public Preview API. It may be changed or removed at any time.
  • Initializes a new instance of NavigationView.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public init(
        _ model: NavigationView.ViewModel,
        action: @escaping (NavigationView.Action) -> ()
    )

    Parameters

    model

    The view model containing the state and data for the navigation view.

    action

    A closure that handles navigation actions.

  • The content and behavior of the view.

    Declaration

    Swift

    public var body: some View { get }
  • Represents different types of actions that can take place in the navigation stack view.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum Action
  • Represents actions taken upon arrival.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum ArrivalAction
  • Represents actions taken based on an instruction.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum InstructionAction
  • Represents actions taken for confirmation.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum ConfirmationAction
  • Represents actions taken when an error occurs.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum ErrorAction
  • ViewModel for the NavigationView. This class is responsible for handling the navigation logic and providing data to the view. It observes the navigation progress, destination arrival, and waypoint arrival.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public final class ViewModel : ObservableObject
  • Sets a closure to be called when the size changes.

    Important

    This is a Public Preview API. It may be changed or removed at any time.

    Declaration

    Swift

    public func onChangedSize(_ action: @escaping (CGSize) -> ()) -> NavigationView

    Parameters

    action

    A closure that is called with the new CGSize as a parameter.

    Return Value

    A modified instance of NavigationView with the size change closure set.