●MAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessage●NATIVE — It unlocks native capabilities React Native cannot reach: AR/LiDAR, Metal 3D, widgets, Dynamic Island, Live Activities, Siri Intents, and HealthKit●RN — Standard Rork builds cross-platform apps with React Native (Expo), a good fit when you want something working fast●CHOICE — Pick React Native for speed, or Rork Max when you need Apple hardware and OS integration●PRICE — Rork is free to start with paid plans from $25/mo; Rork Max is $200/mo●FLOW — Describe the app you want in plain language and Rork produces working code you can ship to the stores●MAX — Rork Max generates native Swift apps for iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessage●NATIVE — It unlocks native capabilities React Native cannot reach: AR/LiDAR, Metal 3D, widgets, Dynamic Island, Live Activities, Siri Intents, and HealthKit●RN — Standard Rork builds cross-platform apps with React Native (Expo), a good fit when you want something working fast●CHOICE — Pick React Native for speed, or Rork Max when you need Apple hardware and OS integration●PRICE — Rork is free to start with paid plans from $25/mo; Rork Max is $200/mo●FLOW — Describe the app you want in plain language and Rork produces working code you can ship to the stores
Building Apple Watch Complications with WidgetKit in a Rork Max App
A concrete walkthrough for adding watchOS complications and Smart Stack support to a SwiftUI app generated by Rork Max, covering target setup, cross-process data sharing, and timeline design.
Putting one number from your app onto the watch face. It sounds small, but it tends to linger as a long piece of homework after you ship a Rork Max app. As an indie developer, in my own work — the wallpaper and habit-tracking apps I keep running — I left them in a "the phone app works, but nothing shows up on the wrist" state for a while. A complication occupies a tiny area, yet it sits exactly where users glance dozens of times a day. Whether you can claim a spot there has a direct line to retention.
This article covers adding watchOS complications to a SwiftUI app generated by Rork Max after the fact, all the way through to getting picked up by the watchOS Smart Stack. I'll lay out where Rork can carry the load and where you have to write the code yourself, with the actual implementation alongside.
Since watchOS 9, complications live in WidgetKit
The first thing to internalize is that complications are now written with WidgetKit, not ClockKit. The ClockKit complication APIs were deprecated in watchOS 9, and today you describe them with the exact same Widget protocol you use for iPhone home-screen widgets. If you've written an iOS widget even once, most of that knowledge transfers directly.
Complication layouts are expressed through the four accessory widget families.
Family
Where it appears
Best for
accessoryCircular
Circular complication slots
A progress ring or single value
accessoryRectangular
Wide slots and the Smart Stack
A title plus 2–3 lines
accessoryInline
The single line atop the face
Short text with an SF Symbol
accessoryCorner
The four corners of the face
A small value with a gauge
Rork Max generates the SwiftUI app itself, but it does not create the watchOS widget extension target for you. That part is a manual job you do in Xcode. Rork Max advertises a no-Xcode flow, but that applies to shipping the main app as-is; the moment you add a separate target like a widget extension, you need to open the exported project in Xcode once. I've come to treat that switch as "the end of what I delegate to Rork."
Lay the foundation: targets and data sharing
A widget extension runs in a different process from your main app. That means it cannot read the data your main app holds directly. The bridge between them is an App Group shared container.
In Xcode, add a Widget Extension via File > New > Target. Be careful to create it as a watchOS target. Then add the same App Group (for example, group.net.dolice.myapp) to the Signing & Capabilities of both the main app and the widget extension.
Writes to the shared container happen on the main-app side. The cleanest approach is to slip a thin bridge over the data layer that Rork Max generated.
import Foundationimport WidgetKitenum SharedStore { static let appGroup = "group.net.dolice.myapp" private static var defaults: UserDefaults? { UserDefaults(suiteName: appGroup) } // Called from the main app. When the value changes, also ask the widget to reload. static func saveStreak(_ days: Int) { defaults?.set(days, forKey: "currentStreak") WidgetCenter.shared.reloadTimelines(ofKind: "StreakComplication") } static func loadStreak() -> Int { defaults?.integer(forKey: "currentStreak") ?? 0 }}
The key here is WidgetCenter.shared.reloadTimelines(ofKind:). Writing to the shared container alone will not refresh the complication. You have to explicitly request a reload at the moment the main app updates the value. Rork Max's generated code handles navigation and state management carefully, but it won't manage a cross-process reload request for you. Assume you'll add this by hand, and you'll save yourself the later "why is the number on the face stale?" headache.
✦
Thank you for reading this far.
Continue Reading
What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.
WHAT YOU'LL LEARN
✦The exact target layout and App Group design for bolting a watchOS widget onto Rork Max's generated code
✦Serving all four accessory families from a single WidgetKit entry
✦Designing TimelineEntryRelevance and an update budget so the Smart Stack surfaces your complication
Secure payment via Stripe · Cancel anytime
✦
Unlock This Article
Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.
The complication itself is a trio of TimelineProvider, Entry, and View. Start with the Entry and provider.
import WidgetKitimport SwiftUIstruct StreakEntry: TimelineEntry { let date: Date let streak: Int // Importance for the Smart Stack. Higher scores surface more readily. let relevance: TimelineEntryRelevance?}struct StreakProvider: TimelineProvider { func placeholder(in context: Context) -> StreakEntry { StreakEntry(date: Date(), streak: 0, relevance: nil) } func getSnapshot(in context: Context, completion: @escaping (StreakEntry) -> Void) { completion(StreakEntry(date: Date(), streak: SharedStore.loadStreak(), relevance: nil)) } func getTimeline(in context: Context, completion: @escaping (Timeline<StreakEntry>) -> Void) { let streak = SharedStore.loadStreak() // Push higher in the Smart Stack as the streak grows. let score: Float = streak >= 7 ? 80 : (streak >= 3 ? 40 : 10) let entry = StreakEntry( date: Date(), streak: streak, relevance: TimelineEntryRelevance(score: score) ) // Next refresh in one hour. Respect the watchOS update budget. let next = Calendar.current.date(byAdding: .hour, value: 1, to: Date())! completion(Timeline(entries: [entry], policy: .after(next))) }}
In the view, read the current family via @Environment(\.widgetFamily) and branch inside a single View. You don't need a separate file per family.
struct StreakComplicationView: View { @Environment(\.widgetFamily) private var family let entry: StreakEntry var body: some View { switch family { case .accessoryCircular: Gauge(value: Double(min(entry.streak, 30)), in: 0...30) { Image(systemName: "flame.fill") } currentValueLabel: { Text("\(entry.streak)") } .gaugeStyle(.accessoryCircular) case .accessoryRectangular: VStack(alignment: .leading) { Label("Streak", systemImage: "flame.fill") .font(.headline) Text("\(entry.streak) days running") .font(.caption) } case .accessoryInline: Label("\(entry.streak)d", systemImage: "flame.fill") default: Text("\(entry.streak)") } }}
Finally, declare the Widget that ties it together and spell out the supported families.
@mainstruct StreakComplication: Widget { var body: some WidgetConfiguration { StaticConfiguration(kind: "StreakComplication", provider: StreakProvider()) { entry in StreakComplicationView(entry: entry) .containerBackground(.fill.tertiary, for: .widget) } .configurationDisplayName("Streak") .description("Shows your habit streak on the watch face.") .supportedFamilies([ .accessoryCircular, .accessoryRectangular, .accessoryInline, .accessoryCorner ]) }}
containerBackground is required on watchOS 10 and later. Without it, the build passes but no background is drawn on the face, and the complication looks like a transparent box. I forgot it at first, didn't notice in the simulator, and only caught it on a real device. Complications are an area where the simulator and a physical watch diverge a lot, so don't skip device testing.
Designing relevance so the Smart Stack picks you up
The watchOS Smart Stack is the vertical pile of widgets that appears when you swipe up from the face. To get your complication to float up there automatically, two things matter: supporting the accessoryRectangular family, and designing TimelineEntryRelevance.
The Smart Stack decides ordering by multiplying each widget's declared relevance.score against time of day and the user's usage patterns. In the provider above, I tiered the score: 80 for a streak of seven or more days, 40 for three or more, 10 below that. If you mark everything high, the system sees a noisy widget that always claims to be important, and it gets buried instead. Raise the score only for the states you genuinely want the user to notice. Whether you exercise that restraint changes Smart Stack exposure considerably.
Beyond relevance, returning multiple entries whose date points to future moments lets you express something like a reservation — "importance rises at this time." For a habit app, slipping in an entry whose score climbs during the evening hours when the user usually logs their habit makes it more likely to appear near the top of the Smart Stack right around then.
The update budget and how to run it realistically
The frequent stumbling block with complications is refresh rate. To save power, watchOS sets a budget on how many times a widget can reload — roughly a few dozen times a day. Specifying .atEnd or an overly short .after in getTimeline burns through that budget fast and updates simply stop.
In practice, combining three update paths stays stable. First, immediate refresh via WidgetCenter.shared.reloadTimelines(ofKind:) when the main app changes a value — the most reliable path, tied directly to user action. Second, periodic refresh via the timeline's .after policy; once an hour sits comfortably inside the budget. Third, when information is time-dependent, return several future entries and let the system handle the rendering. Splitting the work across these three keeps things fresh without wasting budget.
What you want to avoid is hammering reload at short intervals from the main app's background processing. Exhaust the budget and the update won't land when it actually matters. Early on I reasoned "refresh often, just in case" and it backfired. A complication that "tells you only when something changed" ends up showing fresher numbers than one that tries to refresh constantly.
The responsibility boundary with Rork Max
Putting it together, a way of working with Rork Max comes into focus. Let Rork Max generate the main app's screens, data model, and logic, and export it. Add the watchOS widget extension target, configure the App Group, wire up the cross-process reload via WidgetCenter, and design the Smart Stack relevance yourself. Holding that boundary in mind from the start saves you from the "tried to do everything no-code and got stuck" trap.
A complication is a small build, but it creates a touchpoint the user meets many times a day. Reaching this far with whatever energy you have left after shipping the main app changes your app's presence on the wrist quietly, but unmistakably. I hope this helps anyone else building solo.
Share
Thank You for Reading
Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.