Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashikahmad/PrayerTimes-Swift
Islamic Prayer (salah) Time calculation written in swift.
https://github.com/ashikahmad/PrayerTimes-Swift
calculations islam islamic-prayer-times prayer-times swift
Last synced: 2 months ago
JSON representation
Islamic Prayer (salah) Time calculation written in swift.
- Host: GitHub
- URL: https://github.com/ashikahmad/PrayerTimes-Swift
- Owner: ashikahmad
- Created: 2015-04-28T09:43:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-02-17T14:48:50.000Z (almost 5 years ago)
- Last Synced: 2024-08-01T20:35:21.729Z (5 months ago)
- Topics: calculations, islam, islamic-prayer-times, prayer-times, swift
- Language: Swift
- Homepage:
- Size: 281 KB
- Stars: 61
- Watchers: 9
- Forks: 21
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-Islam - PrayerTimes-Swift
- Awesome-Muslims - Prayer Times
README
![](PrayerTimes-Banner.png)
# PrayerTime-Swift
Islamic Prayer (salah) Time calculation written in swift. This prayer time calculation code is *mostly* converted from Objective C version of similar class from [praytimes.org](http://praytimes.org).## What it Does
It calculates prayer times for any date(s) based on:* Latitude/Longitude
* Calculation Method
* Asr Method (Shafi'i/Hanafi)
* ... and optional higher latitude adjustment> For more information about these calculation methods and how it is obtained, check out fine document at [prayertimes.org's wiki page](http://praytimes.org/calculation)
## How to Use
Just import `AKPrayerTime.swift` in your project, and:``` swift
// Create PrayerKit instance with your latitude/longitude
var prayerKit:AKPrayerTime = AKPrayerTime(lat: 23.810332, lng: 90.4125181)
// Optionally, set your preferred calculation method.
// Default is Muslim World Legue (MWL) method
prayerKit.calculationMethod = .Karachi
// Optionally, set your preferred Asr method.
// Default is Safi'i
prayerKit.asrJuristic = .Hanafi
// Optionally, set your output format.
// You can obviously format it later also
prayerKit.outputFormat = .Time12
// ... and finally, get your times
var times = prayerKit.getPrayerTimes()// Then, you can use it as
times[.Fajr] // 04:07 am
times[.Sunrise] // 05:27 am
// ...and follow included example and public methods in source for more possibilities!
```# Basic configurations
Property | Options
--- | ---
calculationMethod | **.MWL** ➠ Muslim World League
**.ISNA** ➠ Islamic Society of North America
**.Egypt** ➠ Egyptian General Authority of Survey
**.Makkah** ➠ Umm al-Qura University, Makkah
**.Karachi** ➠ University of Islamic Science, Karachi
**.Tehran** ➠ Institute of Geophysics, University of Tehran
**.Jafari** ➠ Shia Ithna Ashari, Leva Research Institute, Qum
**.Custom** ➠ Autometically set when parameters are changed manually
asrJuristic | **.Shafii** ➠ As followed by Shafi'i, Maliki, Ja'fari, and Hanbali school
**.Hanafi** ➠ As followed by Hanafi schoolMore details will be added soon. Contribution in both **source** and **documentation** is most welcome!