Athan is a well tested and well documented library for calculating Islamic prayer times. This is a fork of Adhan Swift with added customization.
For SPM add the following to your Package.swift
file:
// swift-tools-version:4.2
dependencies: [
.package(url: "https://github.com/qazwini/athan", .branch("main")),
]
You can also manually add Athan.
- Download the source.
- Add Athan.xcodeproj as a subproject in your app's project.
- Drag Athan.framework to "Linked Frameworks and Libraries" in your app's target.
To get prayer times initialize the PrayerTimes
struct passing in coordinates,
date, and calculation parameters.
let prayerTimes = PrayerTimes(prayers: prayers, coordinates: coordinates, date: date, calculationParameters: params)