Get the FREE Ultimate OpenClaw Setup Guide →

native

Scanned
npx machina-cli add skill xiaobei930/cc-best/native --openclaw
Files (1)
SKILL.md
2.5 KB

原生应用开发

本技能提供原生应用开发的策略选择指南,整合各平台特定的开发模式。

子文件

原生 vs 跨平台

维度原生开发跨平台 (Flutter/RN)
性能最佳接近原生
平台特性完全支持部分支持
开发成本各平台独立一套代码
维护成本较高较低
用户体验最佳良好

选择原生开发的场景

  • 性能敏感应用(游戏、视频)
  • 深度平台集成(系统 API、硬件)
  • 追求极致用户体验
  • 团队有平台专业知识

平台概览

Apple 平台(iOS/macOS)

覆盖范围:iOS/iPadOS、macOS、watchOS/tvOS

技术栈:Swift 6.x、SwiftUI / UIKit、Xcode

详细指南参阅 ios.md

Android(未来)

覆盖范围:Android 手机/平板、Wear OS、Android TV

技术栈:Kotlin、Jetpack Compose / View、Android Studio

通用最佳实践

架构模式

模式iOSAndroid
MVVMSwiftUI + @ObservableCompose + ViewModel
Clean Architecture分层 + 协议分层 + 接口
依赖注入Swift DIHilt/Koin

性能优化

  1. 启动优化 - 延迟加载、预加载
  2. 内存管理 - 避免循环引用、及时释放
  3. UI 流畅 - 主线程保持响应、异步处理
  4. 电量优化 - 减少后台任务、优化网络请求

测试策略

层级覆盖内容
单元测试业务逻辑、ViewModel
集成测试网络层、数据层
UI 测试关键用户流程

记住:原生开发追求的是最佳的平台体验,选择原生意味着要深入理解平台特性。

Source

git clone https://github.com/xiaobei930/cc-best/blob/main/skills/native/SKILL.mdView on GitHub

Overview

Provides guidance for native app development across Apple platforms (iOS/macOS) and Tauri desktop apps. It contrasts native with cross‑platform approaches and outlines when native offers the best performance and UX. The guidance references platform‑specific stacks and patterns to help teams decide and implement native solutions.

How This Skill Works

It organizes guidance by platform and provides a clear decision framework to choose native when performance, platform features, or UX are critical. Technically, it covers Swift‑based stacks (Swift 6.x, SwiftUI/UIKit, Xcode) for Apple platforms and Tauri for desktop apps, along with common architecture patterns and testing strategies.

When to Use It

  • Performance-sensitive apps (games, video) requiring the best native performance
  • Deep platform integration and hardware access (system APIs, sensors, OS features)
  • Pursuit of the best possible user experience on Apple devices
  • Teams with strong platform-specific expertise
  • Desktop apps needing native feel and capabilities via Tauri

Quick Start

  1. Step 1: Review platform guides (ios.md for Apple, tauri.md for desktop) and relevant Swift concurrency/performance docs
  2. Step 2: Choose an architecture (MVVM or Clean Architecture) and set up a DI strategy
  3. Step 3: Implement a performance and testing plan (startup loading, memory management, UI responsiveness; unit/integration/UI tests)

Best Practices

  • Architecture: use MVVM on iOS (SwiftUI + @Observable) and Clean Architecture with layers and interfaces; apply Dependency Injection
  • Performance: optimize startup (lazy/preload), manage memory (avoid retain cycles, timely release), ensure UI responsiveness on main thread, and optimize power usage
  • Testing: cover unit tests for business logic, integration tests for network/data layers, and UI tests for key user flows
  • Platform feature leverage: fully leverage platform APIs, hardware features, and platform‑specific patterns
  • Maintenance planning: anticipate higher per‑platform maintenance costs and plan team structure and ownership accordingly

Example Use Cases

  • High‑performant iOS game using Swift/SwiftUI with optimized startup and memory management
  • macOS app with deep system API integration delivering premium UX
  • Tauri desktop app delivering native‑feel across platforms with platform‑specific optimizations
  • iOS app optimized for UI smoothness and energy efficiency in production
  • Migrating a cross‑platform app to native to unlock platform features and better UX

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers