Is it possible to have this? This is my setup so far:
`
func calculateTime()->Void{
let date = cal.dateComponents([.year, .month, .day], from: Date())
var params = CalculationMethod.moonsightingCommittee.params
params.madhab = .hanafi
params.adjustments.fajr = 3
params.adjustments.sunrise = 2
params.adjustments.dhuhr = 3
params.adjustments.maghrib = -1
params.adjustments.asr = 3
params.adjustments.isha = 3
if let prayers = PrayerTimes(coordinates: coordinates, date: date, calculationParameters: params) {
let formatter = DateFormatter()
formatter.timeStyle = .short
formatter.timeZone = TimeZone(identifier: "Europe/London")!
self.sunrise = formatter.string(from: prayers.sunrise)
self.fajr = formatter.string(from: prayers.fajr)
self.zuhr = formatter.string(from: prayers.dhuhr)
self.asr = formatter.string(from: prayers.asr)
self.maghrib = formatter.string(from: prayers.maghrib)
self.isha = formatter.string(from: prayers.isha)
if let currentPrayer = prayers.currentPrayer() {
self.current = formatter.string(from: prayers.time(for: currentPrayer))
} else {
// if there's no current prayer then it means its between midnight and fajr.
// It's up to you to decide how you want to handle this situation
self.current = formatter.string(from: prayers.fajr)
}
if let nextPrayer = prayers.nextPrayer() {
self.next = formatter.string(from: prayers.time(for: nextPrayer))
} else {
// if there's no current prayer then it means its between midnight and fajr.
// It's up to you to decide how you want to handle this situation
self.next = formatter.string(from: prayers.fajr)
}
}
}`
Is it possible to have this? This is my setup so far: `
func calculateTime()->Void{ let date = cal.dateComponents([.year, .month, .day], from: Date()) var params = CalculationMethod.moonsightingCommittee.params