Home

Awesome

[!IMPORTANT] This package has been deprecated in favor of Swift Navigation.

SwiftUI Navigation

Tools for making SwiftUI navigation simpler, more ergonomic and more precise.

Overview

SwiftUI comes with many forms of navigation (tabs, alerts, dialogs, modal sheets, popovers, navigation links, and more), and each comes with a few ways to construct them. These ways roughly fall in two categories:

Navigation that is "state-driven" is the more powerful form of navigation, albeit slightly more complicated. Unfortunately, SwiftUI does not ship with all of the tools necessary to model our domains with enums and make use of navigation APIs. This library bridges that gap by providing APIs that allow you to model your navigation destinations as an enum, and then drive navigation by a binding to that enum.

Explore all of the tools this library comes with by checking out the documentation, and reading these articles:

Examples

This repo comes with lots of examples to demonstrate how to solve common and complex navigation problems with the library. Check out this directory to see them all, including:

Learn More

SwiftUI Navigation's tools were motivated and designed over the course of many episodes on Point-Free, a video series exploring functional programming and the Swift language, hosted by Brandon Williams and Stephen Celis.

You can watch all of the episodes here.

<a href="https://www.pointfree.co/collections/swiftui/navigation"> <img alt="video poster image" src="https://d3rccdn33rt8ze.cloudfront.net/episodes/0211.jpeg" width="600"> </a>

Community

If you want to discuss this library or have a question about how to use it to solve a particular problem, there are a number of places you can discuss with fellow Point-Free enthusiasts:

Installation

You can add SwiftUI Navigation to an Xcode project by adding it as a package dependency.

https://github.com/pointfreeco/swiftui-navigation

If you want to use SwiftUI Navigation in a SwiftPM project, it's as simple as adding it to a dependencies clause in your Package.swift:

dependencies: [
  .package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "1.0.0")
]

Documentation

The latest documentation for the SwiftUI Navigation APIs is available here.

License

This library is released under the MIT license. See LICENSE for details.