This Swift package provides functionality for determining cardinal, inter-cardinal, and secondary inter-cardinal directions based on a given compass heading/direction/azimuth.
Three levels are granularity are supported:
- Cardinal
- 4 cardinal directions
- ex: N, E, S, W
- Intercardinal
- 8 intercardinal directions
- ex: N, NW, W, SW, etc.
- Secondary intercardinal
- 16 secondary intercardinal directions
- ex: N, NNE, NE, ENE, etc.
The package can be added to Xcode projects via Swift Package Manager.
To add CardinalDirections to your Xcode project, follow these steps:
- In Xcode, open your project and select the project navigator.
- Right-click on the Dependencies folder and select Add Package Dependency.
- In the dialog that appears, enter the URL of this repository: https://github.com/chiliLime/CardinalDirections
- Click Next and then Finish to add the package to your project.
Note: In most cases, simply copying the source file should be sufficient.
To use the CardinalDirections package in your code, import the package at the top of your file:
import CardinalDirections
Contributions to CardinalDirections are welcome! If you find a bug or have an idea for a new feature, please open an issue or create a pull request.
CardinalDirections is released under the MIT License. See LICENSE for details.