Skip to content

Instantly share code, notes, and snippets.

View hansfaffing's full-sized avatar

hans hansfaffing

View GitHub Profile
@hansfaffing
hansfaffing / MoonPhaseIntentAppDelegate.swift
Last active October 26, 2025 17:50
Drop this into a iOS template app's AppDelegate to create an app that provides the Moon Phase via App Intents. Generally a good simple example of how iOS Swift App Intents work.
// Created by HansFaffing on 9/1/25.
// 1. Drop this into a iOS template app's AppDelegate to create an app that provides the Moon Phase via App Intents.
// - New Project -> iOS -> App (Interface: Storyboard, Language: Swift)
// 2. Update the "identifier" below to be correct
// 3. Load onto the iPhone of your choice
// 4. In iOS Shortcuts create a shortcut that uses the current returning Phase from it:
// - Returned value "Current Moon Phase" can be either: "New", "Full", "Waxing", "Waning", or "Error"
// 5. Use however you please, say thanks to hans maybe, refine this quick sketch of work
import UIKit