当前位置: 首页 > Skill >

iOS

iOS

1.0.0 2026.11.25 浏览:622
获取Skill文件查看使用说明
作者:顾安许可证:
本文目录展开

iOS Development Rules

Xcode & Build

  • Clean build folder (Cmd+Shift+K) fixes most "impossible" build errors — derived data gets corrupted regularly
  • Simulator reset (Device > Erase All Content and Settings) clears cached app state that survives reinstalls
  • Archive builds use Release config — bugs that only appear in production often stem from optimization differences
  • xcodebuild -showsdks lists available SDKs — useful when builds fail with "SDK not found"
  • Parallel builds can cause race conditions in script phases — add input/output file lists to enforce ordering

Code Signing

  • "No signing certificate" usually means certificate is expired or revoked — check in Keychain Access, not just Xcode
  • Provisioning profiles embed device UDIDs — new test device requires profile regeneration and reinstall
  • Automatic signing fails in CI — always use manual signing with exported credentials for builds
  • Distribution certificates are limited to 3 per account — don't create new ones, export and share the existing one
  • After renewing a certificate, update ALL provisioning profiles that used the old one

SwiftUI Patterns

  • @State for view-local data, @StateObject for owned ObservableObjects, @ObservedObject for passed-in objects — mixing them wrong causes crashes or lost state
  • List with id: .self on non-Hashable types causes silent failures — always use explicit id parameter with stable identifiers
  • task modifier cancels automatically on view disappear — no manual cancellation needed, but check Task.isCancelled in loops
  • Previews crash silently with real network calls — use mock data or dependency injection for previews
  • @Environment values are nil in previews unless explicitly provided — wrap previews in container with environment set

App Store Rules

  • Apps must work offline or show clear offline state — silent failures cause rejection
  • Login must be skippable if app has non-account features — reviewers reject mandatory login for content browsing
  • "Sign in with Apple" is required if you offer any third-party social login — no exceptions
  • Privacy labels must match actual data collection — Apple verifies and rejects mismatches
  • In-app purchases must use StoreKit for digital goods — external payment links get rejected

Info.plist Requirements

  • ITSAppUsesNonExemptEncryption = NO avoids export compliance questions for most apps — add it to skip the daily annoyance
  • Camera/microphone/location usage descriptions are mandatory — missing them crashes the app on access attempt
  • LSApplicationQueriesSchemes must list URL schemes before canOpenURL works — iOS 9+ security requirement
  • UIRequiresFullScreen = YES on iPad opts out of multitasking — use only if your app truly can't support split view

Performance

  • Instruments > Time Profiler reveals actual bottlenecks — don't guess, measure
  • Images in Assets.xcassets get optimized automatically — loose files in bundle don't
  • @MainActor annotation ensures UI updates happen on main thread — missing it causes random crashes under load
  • Memory leaks often hide in closures — use [weak self] in escaping closures that reference self
  • List with thousands of items is fast, ForEach in ScrollView is not — List uses cell reuse, ScrollView loads everything

Debugging

  • po in LLDB prints object description, p prints raw value — use po for most debugging
  • Purple warnings in Console indicate main thread violations — fix these, they cause jank
  • -com.apple.CoreData.SQLDebug 1 in launch arguments shows all Core Data queries — essential for debugging fetch performance
  • Crash logs without symbols are useless — keep dSYM files for every release build
  • TestFlight crashes appear in Xcode Organizer — check there, not just in App Store Connect

相关文章

更多
iOS App Store内购服务器端PHP验证方法(ThinkPHP)

本文介绍在iOS应用开发中,如何处理App Store内购付款后的服务器端验证流程。前端完成支付后获取的凭证需发送至后端,后端使用PHP(以ThinkPHP为例)调用validate_apple_pay函数对凭证进行校验,并解析返回的状态码以确定交易是否成功。

2025.02.28 116
Skill 文件
  • SKILL.md
    • iOS Development Rules
    • Xcode & Build
    • Code Signing
    • SwiftUI Patterns
    • App Store Rules
    • Info.plist Requirements
    • Performance
    • Debugging
  • 项目或源文件

相关 Skill

更多
hot-china hot-china 中国实时热点数据采集工具,用于获取热搜、热榜、票房、收视、音乐榜单、新闻头条等,覆盖抖音、微博、百度、B站、快手、QQ音乐、网易云、酷狗、酷我、猫眼、App Store、人民日报等平台。
icp-exemption-skill icp-exemption-skill 当检测到用户提及ICP备案、App Store中国区合规、ICP豁免申请等关键词时,自动收集Team ID、账户持有人姓名、App ID等信息,生成符合Apple要求的ICP豁免申请PDF附件。
TestIOS2 TestIOS2 iOS/macOS 应用全生命周期开发技能包。覆盖从需求分析到上架发布的完整流程,包括:工程工作流(需求澄清、PRD生成、任务拆解、Swift TDD、Bug诊断、架构改进)、政策合规监控与动态学习、智能代码生成(Swift/SwiftUI/UIKit)、UI设计系统与美学规范(12大设计法则、631配色、8点网格)、多语言国际化(50+语言)、深色模式适配、架构模式库(MVVM/TCA/VIPER)、性能优化、无障碍、Apple Intelligence集成、App Store上架检查。 触发场景: - 用户问"在iOS/macOS做个App"、"帮我写个SwiftUI视图"、"创建Xcode项目" - 用户需要App Store上架检查、审核指南合规检查、出口合规声明 - 用户询问UI设计规范、配色方案、深色模式适配方案 - 用户需要国际化/本地化支持、多语言切换 - 用户需要代码生成、架构设计、性能优化建议 - 任何涉及Apple开发政策、审核指南、API废弃通知的问题 - 用户说"开发技能"、"应用开发skill"、"iOS开发"、"mac开发" - 用户说"需求分析"、"生
screenmarket-aso-screenshots screenmarket-aso-screenshots 赋能 Codex 将 PRD、产品需求或原始模拟器截图转化为高转化的 App Store 营销素材。具备深度分析应用功能、提炼营销卖点、撰写抓人眼球的中英文标题的能力。能够智能匹配界面与文案,检测截屏质量(清晰度、可读性),并最终渲染生成带手机样机(Frame)的生产级 PNG 图片。适用于 ASO 优化、版本更新素材制作及竞品分析。
Sonar ASO Sonar ASO 通过 Sonar API 为 AI 代理提供 App Store 优化数据,支持关键词研究(难度与热度评分)、应用查找与搜索、ASO 审计和评论分析。