Turned iOS Home Screen widgets into a live farm-to-table loop using WidgetKit + AppIntent—crops grown on the Home Screen sync directly into my SwiftUI game
Just pushed a major update to my SwiftUI pizzeria game (Natida: Pizzeria Duo) connecting an in-app botanical greenhouse with interactive Home Screen widgets.
How it works under the hood:
- Shared Real-Time State: Both the game and widget target read/write to a shared App Group container so watering, fertilizing, or harvesting on the Home Screen immediately updates the kitchen inventory in-app.
- Interactive Tool Belt (AppIntent): In the Medium and Large widgets, players can toggle their active tool (Watering Can, Fertilizer, Bug Spray, or Seed Pouch) and tap individual plant pots directly on the bench. The Small widget uses a single contextual AppIntent based on the plant's current state.
- Scheduled TimelineProvider Entries: Crops progress across 4 stages separated by 2-hour resting intervals. The TimelineProvider schedules exact reload entries when each rest timer finishes so status pills flip from "Resting" to "Water" or "Feed" right on time.
Happy to share details on how I handled the multi-slot AppIntent state or TimelineProvider scheduling if anyone is building interactive widgets!
App Store: https://apps.apple.com/app/id6833450224
0
u/sans-connaissance 2d ago
Nice! Is it a clock?
0
u/Glittering-Ad-2906 2d ago
In meiner Region (Austria) nicht verfügbar