Prayer Times provides a set of handy functions to calculate prayer times for any location around the world, based on a variety of calculation methods currently used in Muslim communities.
You can report any issue on issues page. Note: If you speak Arabic, you can submit issues with Arabic language and I will check them. :)
pod 'PrayerTimesSwift' to your Podfile and go!
PrayerTimesSwift is available through CocoaPods. To install
it, simply add the following line to your Podfile:
You will need to create a new instance of
PrayerTime. Once the instance are configured, you can call
getPrayerTimes() and it's will return a dictionary.
let myPrayerTime = PrayerTimes(caculationmethod: .Makkah, asrJuristic: .Shafii, adjustHighLats: .None, timeFormat: .Time12) let prayerTimes = myPrayerTime.getPrayerTimes(NSCalendar.currentCalendar(), latitude: 24.7993689, longitude: print(prayerTimes) //["Isha": "06:51 pm", "Maghrib": "05:21 pm", "Sunrise": "05:57 am", "Dhuhr": "11:39 am", "Asr": "02:55 pm", "Sunset": "05:21 pm", "Fajr": "04:38 am"]
TimeFormatTo change the time format to:
Time12NS12-hour format with no suffix
Floatingfloating point number
myPrayerTime.timeFormat = .time24
CaculationmethodTo change the Calculation Methods.
KarachiUniversity of Islamic Sciences, Karachi
ISNAIslamic Society of North America (ISNA)
MWLMuslim World League (MWL)
MakkahUmm al-Qura, Makkah
EgyptEgyptian General Authority of Survey
TehranInstitute of Geophysics, University of Tehran
myPrayerTime.Caculationmethod = .makkah
AsrJuristicTo change Juristic Method for Asr
myPrayerTime.asrJuristic = .shafii
AdjustHighLatsAdjusting Methods for Higher Latitudes
MidNightmiddle of night
OneSeventh1/7th of night
AngleBasedangle/60th of night
myPrayerTime.adjustHighLats = .none
tuneTimesTune timings for adjustments
PrayerTimesSwift is available under the MIT license. See the LICENSE file for more info.