Introducing KosherCocoa 2.0

Today I’d like to write about something that has been several months in the making. Between juggling several projects as well as my daily life, I’ve been working on a port of the KosherJava framework. I am pleased to announce that KosherCocoa is at version 2.0. KosherCocoa calculates sunrise, sunset, and a slew of times based on those two times.

Here’s a little more background.

The Jewish daily prayer schedule is governed by what is called “zmanim”, which is the hebrew word for “times”. By the time a certain “zman” arrives, a person must have completed the morning prayers, for example. The evening prayers may not be said before a certain time. These times are calculated based on daylight, using temporal hours.┬áThe KosherJava and KosherCocoa frameworks both (in Java and Objective-C respectively) calculate those times based on sunrise and sunset.

There are a several Rabbinic opinions as to the exact calculation of these times, although several are widely followed. KosherJava is very thorough in its implementation. KosherCocoa 2.0 does not implement all of API offered by KosherJava yet, but I’ve started with the method signatures, and I hope to “fill them in” soon. In the meantime, the basic times do work and can be used immediately. There are about 150 API in total so give me some time to work on those. It’s not complicated, but it is a little tedious. I want to make sure I get it right.

While KosherJava offers several algorithms for sunrise and sunset calculations upon which all the other calculations depend, KosherCocoa implements a port of just one. (It gets the job done, but if anyone needs an alternate calculator, out’s really easy to swap the algorithm via a new AstronomicalCalculator subclass.)

Also, if you’re using the older version of KosherCocoa, please note that the EarthViewer convenience class is deprecated in favor of the AstronomicalCalendar and ZmanimCalendar classes. (I know, the EarthViewer was convenient, but…)

KosherCocoa is a project of Moshe Berman and can be found on his GitHub profile. The original implementation was written in Java, by Eliyahu Hershfeld, and released under the LGPL license. You can find the original at or on Google code. Thanks Eliyahu for all your help!

One Response to Introducing KosherCocoa 2.0

  1. [...] but the majority of zmanim in common use are in the ported ZmanimCalendar. Moshe’s blog post Introducing KosherCocoa 2.0 has additional details. Additional developer notes can be seen in the KosherCocoa wiki page. This [...]