Hello, I have a method that returns an array of times every day.
prayTimesDate(date: NSDate, latitide : Double, longitude : Double, timeZone : Double) -> NSMutableArray
I need to go through a whole year, or maybe a date range, to get an array of times every day for a whole year. I found a lot of links in ruby and python on how to do this, but I could not find anything for swift or objective-c. Are there any built-in methods in quick that this will accomplish? If not, someone can help me as I am still new to programming. Any input is welcome.
This is objective-c code for a method that I am linking to my quick project
- (NSMutableArray *)prayerTimesDate:(NSDate *)date latitude:(double)latitude longitude:(double)longitude andTimezone:(double)timezone
{
unsigned unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay;
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar components:unitFlags fromDate:date];
NSInteger year = [components year];
NSInteger month = [components month];
NSInteger day = [components day];
return [self getDatePrayerTimesForYear:year month:month day:day latitude:latitude longitude:longitude andtimeZone:timezone];
}
source
share