mcpField
E
expo-ui-swift-ui

expo-ui-swift-ui

github.com/expo设计与 UI3.9k295 次安装2 天前更新
代码仓库

关于 expo-ui-swift-ui

expo-ui-swift-ui 是使用 Expo UI 中 SwiftUI 风格 API 构建界面的技能,适用于 Expo SDK 55 项目。它说明如何查阅组件和修饰符文档、重建原生应用,以及在 SwiftUI 视图树中嵌入 React Native 视图。

主要功能

  1. 01面向 SDK 55 的指南
  2. 02SwiftUI 风格的 Expo UI API
  3. 03查阅组件与修饰符文档
  4. 04SwiftUI 视图树使用 Host 包装
  5. 05嵌入 React Native 视图

适用场景

  1. 01构建基于 SwiftUI 的 Expo 界面
  2. 02核对组件和修饰符 API
  3. 03在 SwiftUI 中嵌入 React Native 视图

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/expo/skills --skill expo-ui-swift-ui

安装后在 Claude Code 中输入/expo-ui-swift-ui确认已加载。

附带文件agents/openai.yaml

详细介绍

此技能中的说明仅适用于 SDK 55。对于其他 SDK 版本,请参阅对应版本的 Expo UI SwiftUI 文档,以获取最准确的信息。

安装

npx expo install @expo/ui

安装后需要进行原生重建(npx expo run:ios)。

说明

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>;

评论

支持 Markdown