import CoreSpotlight import MobileCoreServices class SpotlightIndexer static func indexChart(_ birthData: BirthData, positions: [PlanetaryPosition]) let attributeSet = CSSearchableItemAttributeSet(contentType: .text) attributeSet.title = "(birthData.name)'s Natal Chart" attributeSet.contentDescription = positions.map "($0.planet.symbol) in ($0.zodiacSign)" .joined(separator: ", ")
var degreeInSign: Double longitude.truncatingRemainder(dividingBy: 30)
.padding() .frame(width: 200)
import Foundation class PlanetCalculator io astrology software for mac
var zodiacSign: String let signs = ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"] let index = Int((longitude / 30).rounded(.down)) % 12 return signs[index]
var body: some View Form Section("Personal Data") TextField("Name", text: $name) DatePicker("Birth Date", selection: $birthDate, displayedComponents: [.date, .hourAndMinute]) Section("Location") HStack Text("Latitude") TextField("Latitude", value: $latitude, format: .number) HStack Text("Longitude") TextField("Longitude", value: $longitude, format: .number) Section("House System") Picker("System", selection: $selectedHouseSystem) ForEach(HouseSystem.allCases, id: \.self) system in Text(system.rawValue).tag(system) .pickerStyle(.radioGroup) Button("Generate Chart") let birth = BirthData(name: name, date: birthDate, latitude: latitude, longitude: longitude, timezone: .current) saveBirthData(birth) .buttonStyle(.borderedProminent) .padding() .frame(width: 400)
var name: String rawValue.capitalized import Foundation struct PlanetaryPosition: Identifiable let id = UUID() let planet: Planet let longitude: Double // 0-360° let latitude: Double let speed: Double // degrees per day let isRetrograde: Bool let item = CSSearchableItem(uniqueIdentifier: birthData
var formattedPosition: String let degrees = Int(degreeInSign) let minutes = Int((degreeInSign.truncatingRemainder(dividingBy: 1)) * 60) return "\(zodiacSign) \(degrees)°\(minutes)'"
static func calculatePositions(for date: Date, birthData: BirthData? = nil) -> [PlanetaryPosition] return Planet.allCases.map planet in let lon = approximatePosition(planet: planet, date: date) return PlanetaryPosition( planet: planet, longitude: lon, latitude: 0, speed: 1.0, isRetrograde: false )
var body: some Scene WindowGroup ContentView() .windowStyle(.titleBar) .commands CommandMenu("Chart") Button("Recalculate Now") NotificationCenter.default.post(name: .init("recalculate"), object: nil) .keyboardShortcut("R") text: $name) DatePicker("Birth Date"
func updateMenubarText() let now = Date() let moonPhase = getMoonPhase(date: now) statusItem?.button?.title = "🌙 \(moonPhase) ☉ Io"
class AppDelegate: NSObject, NSApplicationDelegate var statusItem: NSStatusItem? var popover: NSPopover?
let item = CSSearchableItem(uniqueIdentifier: birthData.id.uuidString, domainIdentifier: "io.astrology.charts", attributeSet: attributeSet) CSSearchableIndex.default().indexSearchableItems([item]) error in if let error = error print("Index error: \(error)")