ios-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

iOS Development Guidelines

iOS开发指南

Swift and SwiftUI Fundamentals

Swift与SwiftUI基础

  • Use Swift 5.9+ with modern language features
  • Prefer SwiftUI for new UI components
  • Use property wrappers (@State, @Binding, @ObservedObject, @StateObject) appropriately
  • Leverage async/await for asynchronous operations
  • Use Swift concurrency actors for thread-safe code
  • Follow Swift API design guidelines
  • 使用Swift 5.9+及现代语言特性
  • 优先为新UI组件使用SwiftUI
  • 合理使用属性包装器(@State、@Binding、@ObservedObject、@StateObject)
  • 利用async/await处理异步操作
  • 使用Swift并发actor实现线程安全代码
  • 遵循Swift API设计指南

UIKit and AppKit Patterns

UIKit与AppKit模式

  • Maintain compatibility with UIKit where needed
  • Use view controllers with proper lifecycle management
  • Implement Auto Layout constraints correctly
  • Use delegation and notification patterns appropriately
  • Handle memory management with ARC best practices
  • Use storyboards and XIBs sparingly; prefer programmatic UI
  • 在需要时保持与UIKit的兼容性
  • 使用具备正确生命周期管理的视图控制器
  • 正确实现Auto Layout约束
  • 合理使用委托与通知模式
  • 遵循ARC最佳实践处理内存管理
  • 尽量少用故事板(storyboards)和XIB;优先采用程序化UI

iOS Architecture Patterns

iOS架构模式

  • MVVM: Use for SwiftUI-based applications
  • MVC: Use for UIKit-based applications
  • Coordinator: Use for complex navigation flows
  • Implement dependency injection for testability
  • Separate business logic from UI code
  • Use protocols for abstraction and testing
  • MVVM:用于基于SwiftUI的应用
  • MVC:用于基于UIKit的应用
  • Coordinator:用于复杂导航流程
  • 实现依赖注入以提升可测试性
  • 将业务逻辑与UI代码分离
  • 使用协议进行抽象与测试

Core Data and Persistence

Core Data与持久化

  • Use Core Data for complex data models
  • Consider SwiftData for SwiftUI applications
  • Use UserDefaults for simple key-value storage
  • Implement proper data migration strategies
  • Use background contexts for heavy operations
  • Follow Core Data best practices for performance
  • 为复杂数据模型使用Core Data
  • 对于SwiftUI应用可考虑使用SwiftData
  • 为简单键值存储使用UserDefaults
  • 实现合理的数据迁移策略
  • 为重型操作使用后台上下文
  • 遵循Core Data性能最佳实践

iOS Frameworks

iOS框架

  • Combine: Use for reactive programming
  • SwiftUI: Use for declarative UI
  • ARKit: Use for augmented reality features
  • CoreML: Use for machine learning integration
  • MapKit: Use for mapping and location
  • CoreLocation: Use for GPS and location services
  • AVFoundation: Use for media capture and playback
  • WidgetKit: Use for home screen widgets
  • Combine:用于响应式编程
  • SwiftUI:用于声明式UI
  • ARKit:用于增强现实功能
  • CoreML:用于机器学习集成
  • MapKit:用于地图与定位
  • CoreLocation:用于GPS与定位服务
  • AVFoundation:用于媒体捕获与播放
  • WidgetKit:用于主屏幕小组件

App Store Submission and Review Guidelines

App Store提交与审核指南

  • Follow App Store Review Guidelines
  • Implement proper in-app purchase handling
  • Use App Store Connect for distribution
  • Prepare screenshots and metadata
  • Test on TestFlight before release
  • Handle app updates and versioning properly
  • Comply with privacy and data collection policies
  • 遵循App Store审核指南
  • 正确实现内购处理
  • 使用App Store Connect进行分发
  • 准备截图与元数据
  • 发布前在TestFlight上进行测试
  • 正确处理应用更新与版本控制
  • 遵守隐私与数据收集政策

iOS Performance Optimization

iOS性能优化

  • Use Instruments for profiling
  • Optimize image assets and use asset catalogs
  • Implement lazy loading for large lists
  • Use caching strategies appropriately
  • Optimize network requests and data transfer
  • Reduce app launch time
  • Manage memory efficiently to avoid crashes
  • 使用Instruments进行性能分析
  • 优化图片资源并使用资源目录
  • 为大型列表实现懒加载
  • 合理使用缓存策略
  • 优化网络请求与数据传输
  • 缩短应用启动时间
  • 高效管理内存以避免崩溃

Human Interface Guidelines

人机界面指南

  • Follow Apple's Human Interface Guidelines
  • Support Dynamic Type for accessibility
  • Implement proper color contrast
  • Use SF Symbols for icons
  • Support VoiceOver for screen readers
  • Implement haptic feedback appropriately
  • Design for different screen sizes and orientations
  • Support Dark Mode properly
  • 遵循Apple的人机界面指南
  • 支持动态类型以提升可访问性
  • 实现合理的色彩对比度
  • 使用SF Symbols作为图标
  • 支持VoiceOver屏幕阅读器
  • 合理实现触觉反馈
  • 为不同屏幕尺寸与方向进行设计
  • 正确支持深色模式