Astrology Calculator calculates moon's rise/set times, moon Age, moon phases and Zodiac Sign for location and time
📅 Astrology Calculator for Moon Phases, Zodiac Signs & More
🛠 Swift-based astronomical calculations for iOS, macOS & tvOS
✅ Calculates moon rise/set times
✅ Determines moon phases & age
✅ Computes Zodiac sign for a given date & location
✅ Supports iOS, macOS & tvOS
✅ High-precision astronomical calculations
.package(url: "https://github.com/emvakar/EKAstrologyCalc.git", from: "1.0.6")
To use EKAstrologyCalc, import the module and create an instance of MoonPhaseCalculator
. The example below demonstrates how to retrieve moon phase details and zodiac sign based on the current date and location.
import UIKit
import CoreLocation
import EKAstrologyCalc
class ViewController: UIViewController {
let location = CLLocation(latitude: 55.751244, longitude: 37.618423) // Moscow
var moonPhaseManager: EKAstrologyCalc!
override func viewDidLoad() {
super.viewDidLoad()
moonPhaseManager = EKAstrologyCalc(location: location)
let info = moonPhaseManager.getInfo(date: Date())
print("🌍 Current location: \(info.location.coordinate)")
print("📅 Calculation date: \(info.date)")
info.moonModels.forEach {
print("🌙 --- Lunar Day ---")
print("🔢 Lunar Day Number: ", $0.age)
print("🌅 Moonrise: ", $0.rise?.toString(style: .short) ?? "No data")
print("🌄 Moonset: ", $0.set?.toString(style: .short) ?? "No data")
print("♈ Lunar Zodiac Sign: ", $0.sign)
}
print("🌑 Moon Phase: \(info.phase)")
print("📈 Moon Trajectory: \(info.trajectory)")
}
}
This will output on debug console:
🌍 Current location: CLLocationCoordinate2D(latitude: 55.751244, longitude: 37.618423)
📅 Calculation date: 2025-02-09 04:53:16 +0000
🌙 --- Lunar Day ---
🔢 Lunar Day Number: 11
🌅 Moonrise: 09.02.2025, 12:46
🌄 Moonset: 10.02.2025, 07:53
♈ Lunar Zodiac Sign: cancer
Want to improve EKAstrologyCalc? Feel free to:
This project is licensed under the MIT License – see the LICENSE file for details.
🌙 Enjoy using EKAstrologyCalc? Give it a ⭐ to support development!