This guide will help you add Navigation to your SwiftUI project using Swift Package Manager (SPM).
Open your Xcode project where you want to add the Navigation framework.
- Go to File > Swift Packages > Add Package Dependency...
- Alternatively, right-click on your project in the Project Navigator and select Add Packages...
In the search bar, enter the Navigation GitHub repository URL:
https://github.com/0xLeif/Navigation
Select the version of Navigation you wish to install. It's recommended to use the latest stable release.
Click Add Package to add it to your project.
Choose the target(s) where you want to use Navigation.
Click Finish to complete the installation.
If you're using a Package.swift
file, add Navigation to your dependencies:
dependencies: [
.package(
url: "https://github.com/0xLeif/Navigation",
from: "1.0.0"
)
],
Include it in your target dependencies:
targets: [
.target(
name: "YourTargetName",
dependencies: [
.product(
name: "Navigation",
package: "Navigation"
)
]
)
]
Specify the supported platforms:
platforms: [
.iOS(.v16),
.macOS(.v13),
.tvOS(.v16),
.watchOS(.v9)
]
Ensure your development environment meets the following requirements:
- Swift: 6.0 or later
- Xcode: 16.0 or later
- Platforms:
- iOS: 16.0+
- macOS: 13.0+
- tvOS: 16.0+
- watchOS: 9.0+
Now that you’ve installed Navigation, get an overview of its basic functionality and API.