← 返回
未分类 中文

Watchos Code Review

Reviews watchOS code for app lifecycle, complications (ClockKit/WidgetKit), WatchConnectivity, and performance constraints. Use when reviewing code with impo...
审查 watchOS 代码的生命周期、复杂功能(ClockKit/WidgetKit)、WatchConnectivity 以及性能约束。适用于在代码审查时关注重要方面。
anderskev anderskev 来源
未分类 clawhub v1.2.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 378
下载
💾 2
安装
2
版本
#latest

概述

watchOS Code Review

Quick Reference

Issue TypeReference
-----------------------
App lifecycle, scenes, background modes, extended runtimereferences/lifecycle.md
ClockKit, WidgetKit, timeline providers, Smart Stackreferences/complications.md
WCSession, message passing, file transfer, reachabilityreferences/connectivity.md
Memory limits, background refresh, battery optimizationreferences/performance.md

Review Checklist

  • [ ] SwiftUI App protocol used with @WKApplicationDelegateAdaptor for lifecycle events
  • [ ] scenePhase read from root view (not sheets/modals where it's always .active)
  • [ ] WKExtendedRuntimeSession started only while app is active (not from background)
  • [ ] Workout sessions recovered in applicationDidFinishLaunching (not just delegate)
  • [ ] Background tasks scheduled at least 5 minutes apart; next scheduled before completing current
  • [ ] URLSessionDownloadTask (not DataTask) used for background network requests
  • [ ] WidgetKit used instead of ClockKit for watchOS 9+ complications
  • [ ] Timeline includes future entries (not just current state); gaps avoided
  • [ ] TimelineEntryRelevance implemented for Smart Stack prioritization
  • [ ] WCSession delegate set before activate(); singleton pattern used
  • [ ] isReachable checked before sendMessage; transferUserInfo for critical data
  • [ ] Received files moved synchronously before delegate callback returns

When to Load References

  • Reviewing app lifecycle, background modes, or extended sessions -> lifecycle.md
  • Reviewing complications, widgets, or timeline providers -> complications.md
  • Reviewing WCSession, iPhone-Watch communication -> connectivity.md
  • Reviewing memory, battery, or performance issues -> performance.md

Output Format

Report issues using: [FILE:LINE] ISSUE_TITLE

Examples:

  • [WatchApp.swift:18] WKExtendedRuntimeSession started while app not active
  • [ConnectivityManager.swift:42] WCSession.activate() before delegate assignment
  • [ComplicationTimeline.swift:67] Timeline has no future entries

Hard gates (before reporting)

Complete in order for each finding you intend to report. Do not advance until the pass condition is satisfied.

  1. Location artifact — The finding includes [FILE:LINE] (or a line range) copied from the current file contents; the path resolves in this repo.
  2. Scope read — You read the full surrounding unit: the View body, WKApplicationDelegate / scene method, TimelineProvider implementation, WCSessionDelegate callback, or workout/background task handler that owns the behavior—not only a diff hunk.
  3. watchOS or pairing claim (only if the finding depends on background modes, complication/timeline contracts, WCSession reachability or transfer semantics, workout or extended runtime rules, or device-specific limits) — You name one concrete artifact you inspected (for example Info.plist / target capabilities for background modes, the WK* / WCSession call order in source, entitlements, or a subsection you read in the matching doc from Quick Reference) or you downgrade the item to an open question in Review Questions.
  4. Protocol — Pre-report steps in review-verification-protocol are satisfied for this item (no finding if they are not).

Use the issue format [FILE:LINE] ISSUE_TITLE for each reported finding. Hard gate 4 is the full pre-report checklist for this skill’s review type.

Review Questions

  1. Is the app using modern SwiftUI lifecycle with delegate adaptor?
  2. Are background tasks completing properly (calling setTaskCompletedWithSnapshot)?
  3. Is UI update frequency reduced when isLuminanceReduced is true?
  4. Are WatchConnectivity delegate callbacks dispatching to main thread?
  5. Is TabView nested within another TabView? (Memory leak on watchOS)

版本历史

共 2 个版本

  • v1.2.1 当前
    2026-05-03 08:27 安全 安全
  • v1.2.0
    2026-03-31 05:27 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,218
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 688 📥 331,806
education

Tutorial Docs

anderskev
教程模式——面向学习的指南,通过引导式实践教学。用于编写教程、学习指南、入门指南等。
★ 0 📥 777