Generate Native iOS UI with Expo SwiftUI
Guide to building iOS-native UI in Expo with @expo/ui/swift-ui, for Expo SDK 55.
Why it matters
Leverage SwiftUI views and modifiers within your Expo application to build native iOS user interfaces. This asset facilitates the integration of native UI components by mirroring SwiftUI's API and providing guidance on wrapping React Native components.
Outcomes
What it gets done
Integrate SwiftUI views and modifiers into Expo projects using `@expo/ui/swift-ui`.
Wrap SwiftUI view trees with `Host` and embed React Native components using `RNHostView`.
Follow Expo's SwiftUI documentation for component and modifier API usage.
Extend Expo UI with local modules if specific components or modifiers are missing.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-expo-ui-swift-ui | bash Overview
Expo Ui Swift Ui
Guides building iOS-native UI in Expo SDK 55 using @expo/ui/swift-ui, whose API mirrors SwiftUI directly, with Host wrapping and RNHostView for embedding React Native components. Use it when building iOS-native UI in Expo with @expo/ui/swift-ui on SDK 55; these instructions don't apply to other SDK versions.
What it does
Guides building iOS-native UI in Expo using @expo/ui/swift-ui, whose API mirrors SwiftUI's directly - components import from @expo/ui/swift-ui, modifiers from @expo/ui/swift-ui/modifiers. Every SwiftUI tree must be wrapped in Host, and RNHostView is specifically for embedding React Native components (like Pressable) inside that SwiftUI tree. If a required modifier or View is missing, it can be extended via a local Expo module - but only after confirming with the user first. Installation is npx expo install @expo/ui, followed by a required native rebuild (npx expo run:ios).
npx expo install @expo/ui
When to use - and when NOT to
Use it when building iOS-native UI in Expo with @expo/ui/swift-ui, choosing SwiftUI views or modifiers, wrapping component trees in Host, embedding React Native components via RNHostView, or targeting Expo SDK 55's SwiftUI integration specifically - these instructions do not apply to other SDK versions.
Inputs and outputs
Input: a React Native/Expo screen or component needing native iOS UI. Output: a SwiftUI component tree wrapped in Host, with any embedded RN components wrapped in RNHostView, installed and rebuilt for iOS.
Who it's for
Expo developers on SDK 55 building native iOS UI who want SwiftUI's real API surface inside a React Native app rather than a JS-only approximation.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.