GithubHelp home page GithubHelp logo

muzahid59 / prayertimes-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ashikahmad/prayertimes-swift

0.0 2.0 0.0 164 KB

Islamic Prayer (salah) Time calculation written in swift.

Swift 100.00%

prayertimes-swift's Introduction

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.

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

How to Use

Just import AKPrayerTime.swift in your project, and:

// 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 school

More details will be added soon. Contribution in both source and documentation is most welcome!

prayertimes-swift's People

Contributors

ashikahmad avatar

Watchers

James Cloos avatar Muzahidul Islam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.