batoulapps / adhan-swift

High precision Islamic prayer time library for Swift
MIT License
185 stars 45 forks source link

Timings do not appear #66

Closed marsix closed 2 years ago

marsix commented 3 years ago

The timings do not appear for me in the interface, they only appear below, which means that the code works but does not appear <<<<<<<<<<<<

import UIKit import Adhan

class ViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    let cal = Calendar(identifier: Calendar.Identifier.gregorian)
    let date = cal.dateComponents([.year, .month, .day], from: Date())
    let coordinates = Coordinates(latitude: 35.78056, longitude: -78.6389)
    var params = CalculationMethod.moonsightingCommittee.params
    params.madhab = .hanafi
    if let prayers = PrayerTimes(coordinates: coordinates, date: date, calculationParameters: params) {
        let formatter = DateFormatter()
        formatter.timeStyle = .medium
        formatter.timeZone = TimeZone(identifier: "America/New_York")!

        print("fajr \(formatter.string(from: prayers.fajr))")
        print("sunrise \(formatter.string(from: prayers.sunrise))")
        print("dhuhr \(formatter.string(from: prayers.dhuhr))")
        print("asr \(formatter.string(from: prayers.asr))")
        print("maghrib \(formatter.string(from: prayers.maghrib))")
        print("isha \(formatter.string(from: prayers.isha))")
    }

    // Do any additional setup after loading the view.
}

}