技能 编程开发 Expo SwiftUI 原生界面开发

Expo SwiftUI 原生界面开发

v20260927
expo-ui-swift-ui
在 Expo 应用中使用 @expo/ui/swift-ui 构建 iOS 原生界面,API 与 SwiftUI 一致。涵盖 Host 包裹、RNHostView 嵌入 React Native 组件以及 SDK 55 用法与扩展指南。
获取技能
337 次下载
概览

name: expo-ui-swift-ui description: @expo/ui/swift-ui package lets you use SwiftUI Views and modifiers in your app.

The instructions in this skill apply to SDK 55 only. For other SDK versions, refer to the Expo UI SwiftUI docs for that version for the most accurate information.

When to Use

  • You need to build iOS-native UI in Expo using @expo/ui/swift-ui.
  • The task involves selecting SwiftUI views or modifiers, wrapping trees in Host, or embedding React Native components with RNHostView.
  • You are targeting Expo SDK 55 behavior for SwiftUI integration and extension guidance.

Installation

npx expo install @expo/ui

A native rebuild is required after installation (npx expo run:ios).

Instructions

import { Host, VStack, RNHostView } from "@expo-ui/swift-ui";
import { Pressable } from "react-native";

<Host matchContents>
  <VStack>
    <RNHostView matchContents>
      // Here, `Pressable` is an RN component so it is wrapped in `RNHostView`.
      <Pressable />
    </RNHostView>
  </VStack>
</Host>;

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
信息
Category 编程开发
Name expo-ui-swift-ui
版本 v20260927
大小 2.29KB
更新时间 2026-09-28
语言