This guide will walk you through the process of installing AppState into your Swift project using Swift Package Manager.
AppState can be easily integrated into your project using Swift Package Manager. Follow the steps below to add AppState as a dependency.
Add AppState to the dependencies
section of your Package.swift
file:
dependencies: [
.package(url: "https://github.com/0xLeif/AppState.git", from: "2.0.0")
]
Include AppState in your target’s dependencies:
.target(
name: "YourTarget",
dependencies: ["AppState"]
)
Once you’ve added AppState to your Package.swift
file, build your project to fetch the dependency and integrate it into your codebase.
swift build
Now, you can start using AppState in your project by importing it at the top of your Swift files:
import AppState
If you prefer to add AppState directly through Xcode, follow these steps:
Open your Xcode project or workspace.
- Navigate to the project navigator and select your project file.
- In the project editor, select your target, and then go to the "Swift Packages" tab.
- Click the "+" button to add a package dependency.
In the "Choose Package Repository" dialog, enter the following URL: https://github.com/0xLeif/AppState.git
Then click "Next."
Choose the version you wish to use. It's recommended to select the "Up to Next Major Version" option and specify 2.0.0
as the lower bound. Then click "Next."
Xcode will fetch the package and present you with options to add AppState to your target. Make sure to select the correct target and click "Finish."
You can now import AppState at the top of your Swift files:
import AppState
With AppState installed, you can move on to the Usage Overview to see how to implement the key features in your project.