Code Once, Pin Everywhere: Multiplatform Widgets for Android & iOS
summary
Shows a working approach: one shared Kotlin core drives widgets on Android and iOS (real repo MatchPin, >2k GitHub stars example) using Kotlin Multiplatform with native UIs via Glance and WidgetKit. Shares fetch, domain, state, refresh policy and uses Flows + Touchlab Sky for Swift async interop; native glue uses WorkManager and app groups. Claims ~90% logic shareable, ~10% native pixels; warns iOS extension memory ceiling (~30 MB) vs Kotlin/Native GC target (~100 MB), and OS-limited refresh budgets (40–70/day; 15–60 min).
AI-written summary · about
chapters (38)
- 0:00Introduction
- 1:39The widget duplication trap
- 2:35Shared logic potential
- 3:46Defining the roadmap
- 5:10What to build twice
- 8:20The smart move
- 8:44Status quo and precedents
- 12:14Architecture and seams
- 13:37UI constraints
- 14:39Platform rendering rules
- 16:00Reactive vs. punctual
- 17:05Shared interface design
- 18:58The redrawing glue
- 20:25Background scheduling
- 21:16Integrating flows with SKIE
- 22:55iOS app group challenges
- 24:45The thin widget pattern
- 25:36Demo: MatchPin
- 26:24Real-time vs. sampled
- 29:45Accepting the leash
- 30:15The messy truth: reactive myths
- 31:13Android's background limits
- 32:23Escape hatches: push
- 33:09The iOS memory fight
- 34:05Memory collision details
- 35:36Mitigating memory crashes
- 36:51Consequences of failure
- 38:10Sharing policies
- 39:09When to use live activities
- 40:19The value of 90% sharing
- 41:48Final verdict
- 42:22The scary part is the widget
- 43:43Decision framework
- 45:03Final call to action
- 47:00Resources and links
- 47:26Community and closing
- 48:52Q&A setup
- 49:18Final thank you
