iOS 应用开发指南,涵盖 UIKit、SwiftUI、SnapKit。 包括触控目标、安全区域、导航模式、Dynamic Type、深色模式、无障碍访问、 集合视图、Apple HIG 合规性。 触发条件:开发 iOS 应用、实现 UI、使用 UIKit/SwiftUI 布局、 构建 iPhone 界面、Apple HIG 合规检查。
.ignoresSafeArea() 仅做背景)preferredFont(forTextStyle:) + adjustsFontForContentSizeCategory = true.headline、.body、.captionUIFontMetrics / Font.custom(_:size:relativeTo:).systemBackground、、).label.primaryaccessibilityLabel()@Environment(\.accessibilityReduceMotion))accessibilitySortPriority())@SceneStorage,@State)| 用途 | 组件 |
|---|---|
| 主要区块 | UITabBarController |
| 钻取导航 | UINavigationController |
| 聚焦任务 | Sheet presentation |
| 关键选择 | UIAlertController |
| 列表内容 | UICollectionView + DiffableDataSource |
| 网格布局 | UICollectionViewCompositionalLayout |
| 搜索 | UISearchController |
| 分享 | UIActivityViewController |
| 线性布局 | UIStackView |
| 自定义形状 | CAShapeLayer + UIBezierPath |
| 渐变 | CAGradientLayer |
| 动态文本 | UIFontMetrics + preferredFont |
| 深色模式 | 语义颜色 |
| 用途 | 组件 |
|---|---|
| 主要区块 | TabView + tabItem |
| 钻取导航 | NavigationStack + NavigationPath |
| 聚焦任务 | .sheet + presentationDetents |
| 关键选择 | .alert |
| 列表内容 | List + .insetGrouped |
| 搜索 | .searchable |
| 分享 | ShareLink |
| 反馈 | UIImpactFeedbackGenerator |
| 动态文本 | .font(.body) 语义样式 |
| 深色模式 | .primary、.secondary、Color(.systemBackground) |
| 减少动画 | @Environment(\.accessibilityReduceMotion) |
| 动态字体大小 | @Environment(\.dynamicTypeSize) |
references/layout-system.md — 触控目标、安全区域、CollectionViewreferences/navigation-patterns.md — TabBar、NavigationController、Modalreferences/uikit-components.md — StackView、Button、Alert、Search、ContextMenureferences/graphics-animation.md — CAShapeLayer、CAGradientLayer、Core Animationreferences/accessibility.md — Dynamic Type、语义颜色、VoiceOverreferences/system-integration.md — 权限、位置、分享、生命周期、触觉反馈references/swiftui-design-guidelines.md — SwiftUI HIG、组件、模式、反模式references/swift-coding-standards.md — Optionals、Protocols、async/await、ARC、错误处理