RORK LABJP
BUILD — Rork Max runs real Macs in the cloud loaded with Xcode and the iOS SDK, writing SwiftUI, compiling, reading the errors and building again. That loop, not the code generation, is what lifts the outputNATIVE — What comes out is pure Swift and SwiftUI, not React Native. Reaching AR, Metal graphics and widgets that React Native cannot touch is the real gap between this and other buildersPLATFORMS — Coverage spans iPhone, iPad, Apple Watch, Apple TV and Vision Pro, plus iMessage. Worth a look if you want to start from a watch app or an extension rather than a phone screenCOMPANION — The Rork Companion app lets you check a generated build on a real iPhone without a paid Apple Developer account, lowering the bar for trying a first project end to endPRICING — Free to start, paid plans from $25 a month, and Rork Max on the $200 Max plan. Worth working out up front how many projects it takes to earn that backDEADLINE — From August 31, 2026, Google Play requires target API level 36 or higher for new apps and updates alike. Ten days out, and the targetSdkVersion of what you generate is yours to verifyBUILD — Rork Max runs real Macs in the cloud loaded with Xcode and the iOS SDK, writing SwiftUI, compiling, reading the errors and building again. That loop, not the code generation, is what lifts the outputNATIVE — What comes out is pure Swift and SwiftUI, not React Native. Reaching AR, Metal graphics and widgets that React Native cannot touch is the real gap between this and other buildersPLATFORMS — Coverage spans iPhone, iPad, Apple Watch, Apple TV and Vision Pro, plus iMessage. Worth a look if you want to start from a watch app or an extension rather than a phone screenCOMPANION — The Rork Companion app lets you check a generated build on a real iPhone without a paid Apple Developer account, lowering the bar for trying a first project end to endPRICING — Free to start, paid plans from $25 a month, and Rork Max on the $200 Max plan. Worth working out up front how many projects it takes to earn that backDEADLINE — From August 31, 2026, Google Play requires target API level 36 or higher for new apps and updates alike. Ten days out, and the targetSdkVersion of what you generate is yours to verify
Articles/App Dev
App Dev/2026-07-01Advanced

Building SharePlay in Rork Max's Native Swift — Keeping Two Screens in the Same State

Implementation notes on building SharePlay with GroupActivities in Rork Max's native Swift — moving two screens through the same state over FaceTime. Covers declaring the GroupActivity, joining a GroupSession, syncing state with GroupSessionMessenger, handling latency and conflicts, catching up late joiners, and the boundary for bridging from React Native, with the pitfalls I actually hit.

SharePlayGroupActivitiesRork Max233iOS110SwiftUI64

Premium Article

There are moments when you want to look at the same screen together with family who live far away, while on a call — not trading photos one at a time, but where the moment you swipe, their screen shows the same photo too. That "seeing the same thing together" experience is harder to build than it looks, and once it works, it is quietly delightful. As an indie developer who has run a few small utility apps on my own for years — monetized mostly through AdMob on the App Store — I have come to see SharePlay as one of the rare mechanisms that turns "a tool you use alone" into "a space you use with someone."

The foundation for it is GroupActivities. It layers your app's session on top of a FaceTime call and keeps the state aligned across every participant's device. The catch is that this lives entirely in native territory — there is no API you can reach cleanly from JavaScript. That is exactly why it matters that Rork Max now generates native Swift. Here, I will build the smallest SharePlay that moves two screens through the same state, and walk through the spots where I actually got stuck.

Why this is not realistic in the React Native version

Getting this straight up front makes the later design choices easier. The core of SharePlay is the GroupActivities framework: conforming to the GroupActivity protocol, receiving a GroupSession asynchronously, and exchanging low-level messages through GroupSessionMessenger. All of these are tied deeply to Swift types and async sequences — the kind of thing that fits poorly across a bridge.

AspectReact Native (Expo) aloneRork Max native Swift
Conforming to GroupActivityCannot be expressed in JS typesDeclared plainly as a Swift struct
Receiving a GroupSessionAsync sequences are awkward to bridgeTaken directly with for await
State-sync granularityCarries bridge round-trip latencyStays inside native, stays light
System UI integrationHard to surface in the share pickerRides the OS SharePlay UI naturally

At first I assumed a thin wrapper as an Expo native module would be enough. But once I tried to bridge both receiving the GroupSession and the Messenger's send/receive, the state drifted every time it crossed the boundary — a sync that stopped being a sync. For SharePlay, I have concluded that the practical move is to place the heart of the experience on the native side and let React Native only tap "start" and "stop." Because Rork Max generates that central part in Swift, that separation actually holds together as an implementation.

Declaring the "activity" you do together

SharePlay starts by declaring, as a type, what you are doing together. That activity becomes the unit shared among participants. For a "swipe through photos together" experience, you give it the minimum information needed to identify what is being paged.

import GroupActivities
 
struct SharedGalleryActivity: GroupActivity {
    // Identifier for the gallery being viewed together
    var galleryID: String
 
    var metadata: GroupActivityMetadata {
        var meta = GroupActivityMetadata()
        meta.title = "View a gallery together"
        meta.type = .generic     // .generic unless it is video or music
        return meta
    }
}

Choose type by purpose. For synchronized video use .watchTogether, for music .listenTogether, and the system will even handle playback controls for you. But for syncing your own custom screen, .generic is far easier to work with. Set it to .watchTogether and the OS starts expecting a playback UI, which ends up fighting you. I got that wrong at first and spent a while confused about why extra controls kept appearing on screen.

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
Follow the full arc in working Swift — from declaring a GroupActivity to joining a GroupSession to tearing it down
A minimal design for keeping two devices in the same state with GroupSessionMessenger, plus how to handle latency, conflicts, and catching up people who join late
Why SharePlay is not realistic in the React Native version and needs Rork Max's native generation, explained at the implementation level
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.

or
Unlock all articles with Membership →
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.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-07-01
Building a Song-Recognition App with ShazamKit in Rork Max's Native Swift
Implementation notes on building a song-recognition app with SHManagedSession in Rork Max's native Swift. Covers the difference from hand-rolling AVAudioEngine, designing the idle / prerecording / matching states, using prerecording to improve initial accuracy, and the boundary design for bridging from Expo — with the pitfalls I actually hit.
App Dev2026-06-28
Building a Live Barcode and Text Scanner in Rork Max with VisionKit's DataScanner
Add a live barcode and text scanner to your Rork Max native Swift app using VisionKit's DataScanner. Covers the SwiftUI bridge, availability handling, throttling repeated detections, and on-device verification with working code.
App Dev2026-07-03
Making Your Rork Max App Resilient to Dropped and Restored Connections: Offline Detection and Retry with NWPathMonitor
Build networking that survives a lost signal in your Rork Max native Swift app with NWPathMonitor. Detect offline states, respect Low Data Mode and cellular, and auto-resend queued work on reconnect — all with working Swift code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →