Axiom Uikit

charleswiltgen/axiom/.claude-plugin/plugins/axiom/skills/axiom-uikit

作者 charleswiltgene45d98ffbb5fMIT1.1K 個星標收錄於 2026年10月9日更新於 2026年10月8日儲存庫今天更新

Use when bridging UIKit and SwiftUI, modernizing UIKit apps (scene lifecycle, resizability), debugging Auto Layout, Combine, TextKit, PencilKit, or UIKit animations.

AI 產生的概覽

UIKit 開發參考路由:SwiftUI 橋接、Auto Layout、動畫、Combine、TextKit、PencilKit 與應用程式現代化。

功能
這是一個僅含說明的路由型技能,針對 Apple UIKit 開發。它會把症狀與任務對應到參考文件,涵蓋 UIKit 與 SwiftUI 互相橋接、自適應佈局、Auto Layout 除錯、UIKit 動畫除錯、Combine 模式、TextKit、PencilKit/PaperKit,以及場景生命週期與可調整大小等 UIKit 現代化主題。它也會指向一項尺寸調整就緒度稽核流程,並說明與 SwiftUI、並行、效能和資料相關技能之間的衝突處理規則。產出是指引與對應參考檔案的方向,而不是程式碼或檔案。
適用情境
適用於處理 UIKit 程式碼或 UIKit 與 SwiftUI 交界處的工作,例如把 UIKit 檢視包裝進 SwiftUI,或在 UIKit 應用程式中嵌入 SwiftUI。也適合除錯約束衝突、CAAnimation 問題、Combine 訂閱生命週期、TextKit 或 PencilKit 行為,以及為場景生命週期與可調整佈局進行應用程式現代化。
執行需求
不需要指令碼,只有說明與參考文件。代理需要檔案搜尋與讀取所引用技能檔案的權限。部分被引用的稽核代理需要 Bash、建置、測試或模擬器,並註明無法以內嵌形式使用。

UIKit & Bridging

You MUST use this skill for ANY UIKit bridging, Auto Layout, Combine, TextKit, or UIKit animation work.

<!-- AXIOM_AUDITOR_INLINE_BEGIN — auto-maintained by scripts/build-inlined-auditors.ts; do not hand-edit -->

Not on Claude Code? Where this router says "Launch some-auditor agent", read that auditor's file in this suite and follow it inline — the same procedure, needing only file search and read.

Available here: skills/resize-auditor.md.

Agents that need Bash — builds, tests, simulators, crash symbolication — stay Claude Code-only; there is no inline equivalent for those.

<!-- AXIOM_AUDITOR_INLINE_END -->

Quick Reference

Symptom / TaskReference
UIViewRepresentable, UIViewControllerRepresentableSee skills/uikit-bridging.md
Embedding SwiftUI in UIKit (UIHostingController)See skills/uikit-bridging.md
Coordinator pattern, updateUIView lifecycleSee skills/uikit-bridging.md
Building adaptive UIKit layout: guides, width-conditional constraints, compositional layout, self-sizing cellsSee skills/adaptive-layout.md
"Unable to simultaneously satisfy constraints"See skills/auto-layout-debugging.md
Constraint conflicts, ambiguous layoutSee skills/auto-layout-debugging.md
Views not appearing, positioned incorrectlySee skills/auto-layout-debugging.md
CAAnimation completion handler not firingSee skills/uikit-animation-debugging.md
Spring physics wrong on device, duration mismatchSee skills/uikit-animation-debugging.md
Animation jank, CATransaction timingSee skills/uikit-animation-debugging.md
Combine publishers, AnyCancellable lifecycleSee skills/combine-patterns.md
@Published properties, Combine ↔ async/awaitSee skills/combine-patterns.md
When to use Combine vs async/awaitSee skills/combine-patterns.md
UIScene lifecycle required, resizable apps, size classes, tab sidebar OS27See skills/uikit-modernization.md
iPhone Mirroring compat: indirect input, companion Face ID, portrait trapSee skills/uikit-modernization.md
Scene edges: teardown, activation requests, per-scene restoration, external display, activeAppearanceSee skills/uikit-modernization.md
Nav bar title and subtitle: UINavigationItem.subtitle, largeSubtitleView, attributedTitle/attributedSubtitle, subtitle text attributes (iOS 26)See skills/uikit-modernization.md
Automated resize-readiness scan (scene lifecycle, UIScreen.main, fixed-canvas, Mirroring input, iPhone Duo)Launch resize-auditor agent or /axiom:audit resize
iPhone Duo in UIKit: vertical bars, the fold, window requests on the outer displaySee axiom-swiftui (skills/iphone-duo.md) — UIKit equivalents sit beside each SwiftUI API
TextKit 2 architecture, NSTextLayoutManagerSee skills/textkit-ref.md
Writing Tools integration (iOS 26)See skills/textkit-ref.md
Viewport rendering surfaces, attachment reuse, collapsible text OS27See skills/textkit-ref.md
SwiftUI TextEditor, TextKit 1 migrationSee skills/textkit-ref.md
Grammar checking (UITextChecker), per-edge text-block borders OS27See skills/textkit-ref.md
PencilKit canvas, PKToolPicker, drawing persistenceSee skills/pencilkit-paperkit.md
Apple Pencil Pro (squeeze, barrel roll, hover, haptics)See skills/pencilkit-paperkit.md
Handwriting recognition (PKStrokeRecognizer), stroke identity/slicing OS27See skills/pencilkit-paperkit-ref.md
PaperKit markup canvas (shapes, images, text + drawing)See skills/pencilkit-paperkit-ref.md
PaperKit programmatic markup model (subelements, adornments) OS27See skills/pencilkit-paperkit-ref.md

Decision Tree

dot
digraph uikit {    start [label="UIKit task" shape=ellipse];    what [label="What do you need?" shape=diamond];
    start -> what;    what -> "skills/uikit-bridging.md" [label="wrap UIKit in SwiftUI\nor SwiftUI in UIKit"];    what -> "skills/adaptive-layout.md" [label="build adaptive layout\n(guides, constraint sets,\ncompositional)"];    what -> "skills/auto-layout-debugging.md" [label="constraint errors,\nlayout issues"];    what -> "skills/uikit-animation-debugging.md" [label="CAAnimation bugs,\nspring physics,\ncompletion handlers"];    what -> "skills/combine-patterns.md" [label="publishers, sinks,\n@Published,\nasync/await bridge"];    what -> "skills/textkit-ref.md" [label="text layout,\nWriting Tools,\nTextKit migration"];    what -> "skills/pencilkit-paperkit.md" [label="drawing canvas,\nApple Pencil,\nPaperKit markup"];    what -> "skills/uikit-modernization.md" [label="scene lifecycle (required 27),\nresizable apps,\nsize classes"];}
  1. Scene-lifecycle migration, "app won't launch on 27", resizability, size classes, tab sidebar? → skills/uikit-modernization.md 0b. App misbehaves in iPhone Mirroring (gestures dead, Face ID blocked, layout stuck portrait)? → skills/uikit-modernization.md 0c. iPhone Duo / foldable iPhone (vertical bars, the fold, outer-display window requests)? → axiom-swiftui (skills/iphone-duo.md)
  2. UIViewRepresentable / UIViewControllerRepresentable / UIHostingController? → skills/uikit-bridging.md
  3. "Unable to simultaneously satisfy constraints" / layout bugs? → skills/auto-layout-debugging.md 2b. Building a layout that adapts (layout guides, size-class constraint sets, compositional column math, self-sizing cells)? → skills/adaptive-layout.md
  4. CAAnimation completion missing / spring physics wrong / animation jank? → skills/uikit-animation-debugging.md
  5. Combine publishers / AnyCancellable / @Published / Combine ↔ async bridge? → skills/combine-patterns.md
  6. TextKit 2 / Writing Tools / TextEditor / TextKit 1 migration? → skills/textkit-ref.md
  7. PencilKit canvas / Apple Pencil / PaperKit markup? → skills/pencilkit-paperkit.md
  8. Pure SwiftUI view question (no UIKit bridging)? → /skill axiom-swiftui
  9. Design decisions, HIG, Liquid Glass, SF Symbols, typography? → /skill axiom-design
  10. Block retain cycles in UIKit callbacks? → See axiom-performance (skills/objc-block-retain-cycles.md)
  11. Memory leaks from Combine subscriptions? → Start with skills/combine-patterns.md, then axiom-performance if leak persists

Conflict Resolution

uikit vs swiftui: When working with UI code:

  • Use uikit when wrapping UIKit in SwiftUI or vice versa, or debugging UIKit-specific issues (Auto Layout, CAAnimation)
  • Use swiftui for pure SwiftUI views, navigation, layout, animations

uikit vs concurrency: When Combine interacts with async/await:

  • Use uikit (skills/combine-patterns.md) for bridging Combine pipelines with async/await
  • Use concurrency for pure async/await patterns, actors, Sendable

uikit vs performance: When animations or layout cause performance issues:

  1. Try uikit FIRST — Most animation jank is CATransaction timing or layer state, not a profiling issue
  2. Only use performance if animation logic is correct but rendering is slow

uikit vs axiom-data: When @Published properties relate to data persistence:

  • Use uikit for Combine publisher patterns and @Published lifecycle
  • Use axiom-data for SwiftData/Core Data model layer concerns

Anti-Rationalization

ThoughtReality
"I'll just use UIHostingController, it's simple"Hosting has sizing, lifecycle, and navigation edge cases. skills/uikit-bridging.md covers the gotchas.
"Auto Layout error is just a warning, I'll ignore it"Unsatisfied constraints cause unpredictable layout at runtime. Fix them now.
"I know how CAAnimation works"90% of CAAnimation bugs are CATransaction timing, not Core Animation. Check skills/uikit-animation-debugging.md.
"Combine is dead, just rewrite with async/await"Combine has no deprecation notice. Rewriting working pipelines wastes time. skills/combine-patterns.md covers when to migrate vs maintain.
"TextKit 1 still works fine"TextKit 1 misses Writing Tools integration and has known layout bugs Apple won't fix. See skills/textkit-ref.md.
"I'll store cancellables in a local variable"Local AnyCancellable deallocates immediately, killing the subscription.
"I'll archive the PKCanvasView to save the drawing"Archiving the view loses editability. Persist drawing.dataRepresentation(). See skills/pencilkit-paperkit.md.
"My tool picker won't show, the API must be broken"The canvas must becomeFirstResponder() after setVisible(_:forFirstResponder:). See skills/pencilkit-paperkit.md.

Example Invocations

User: "How do I wrap a UIKit view in SwiftUI?" → Read: skills/uikit-bridging.md

User: "I'm getting 'Unable to simultaneously satisfy constraints'" → Read: skills/auto-layout-debugging.md

User: "My CAAnimation completion handler never fires" → Read: skills/uikit-animation-debugging.md

User: "Should I use Combine or async/await for this?" → Read: skills/combine-patterns.md

User: "How do I integrate Writing Tools with my text editor?" → Read: skills/textkit-ref.md

User: "How do I add an Apple Pencil drawing canvas with the tool picker?" → Read: skills/pencilkit-paperkit.md

User: "How do I add a PaperKit markup canvas with shapes and text?" → Read: skills/pencilkit-paperkit-ref.md

User: "My SwiftUI view has a memory leak from a Combine subscription" → Read: skills/combine-patterns.md

User: "How do I embed SwiftUI in my UIKit app?" → Read: skills/uikit-bridging.md

User: "Audit my app for screen resizing support" → Launch resize-auditor agent (or /axiom:audit resize)

User: "My custom pinch gesture stops working when the app runs in iPhone Mirroring" → Read: skills/uikit-modernization.md

User: "How do I vary my collection view's column count with the window width?" → Read: skills/adaptive-layout.md

來源與署名

來源:charleswiltgen/axiom位於.claude-plugin/plugins/axiom/skills/axiom-uikit提交e45d98f

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架