Installation
Swift
Download and install Swift 5.3 or higher.
Swift Package Manager
New Package
This creates a new executable package named MyPackage.
mkdir MyPackage
cd MyPackage
swift package init --type executable
Package Manifest
Add the Routing package as a dependency by specifying its name, url, and version.
dependencies: [
.package(name: "chaqmoq-routing", url: "https://github.com/chaqmoq/routing.git", from: "1.0.0")
]
Add the Routing target to your desired target as a dependency by specifying its name and package where you want to import and use it. In this case, we are adding it to the default target named MyPackage generated using the swift package init command we executed earlier.
targets: [
.target(name: "MyPackage", dependencies: [
.product(name: "Routing", package: "chaqmoq-routing")
])
]
Build
This builds the MyPackage and installs the Routing package with the Debug configuration needed for development.
swift build
Once you are ready to deploy, you can run the command below that builds the MyPackage and installs the Routing package with the Release configuration optimized for production.
swift build -c release
Xcode Project
- Open your
Xcodeproject. - Go to
File->Swift Packages->Add Package Dependency. - Enter the
Routingpackage URL:https://github.com/chaqmoq/routing.git. - Choose the version you want to install. We suggest installing the latest stable version by using the Up to Next Major strategy.
- Add the
Routingpackage to your desired target of theMyPackagewhere you want to import and use it.