Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

uikit-expertuikit 专家

Agent Skill

uikit-expert 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,426

周安装

60

GitHub Stars

2

下载量

499
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:uikit-expert(uikit 专家)
来源仓库:https://github.com/ivan-magda/uikit-expert-skill
仓库路径:skills/uikit-expert
安装命令:
npx skills add https://github.com/ivan-magda/uikit-expert-skill --skill uikit-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ivan-magda/uikit-expert-skill --skill uikit-expert

简介

uikit-expert 用于处理 GitHub 仓库、Issue 和 Pull Request。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态。uikit-expert 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写。

SKILL.md

UIKit Expert Skill

Overview

Use this skill to build, review, or improve UIKit features with correct lifecycle management, performant Auto Layout, modern collection view APIs, and safe navigation patterns. Prioritize native APIs, Apple's documented best practices, and performance-conscious patterns. This skill focuses on facts and best practices without enforcing specific architectural patterns (no MVVM/VIPER/Coordinator mandates).

Workflow Decision Tree

1) Review existing UIKit code

  • Check view controller lifecycle usage — viewIsAppearing for geometry, viewDidLoad for setup only (see references/view-controller-lifecycle.md)
  • Verify Auto Layout correctness — batch activation, no constraint churn, translatesAutoresizingMaskIntoConstraints (see references/auto-layout.md)
  • Check collection/table view APIs — diffable data sources, stable identity, CellRegistration (see references/modern-collection-views.md)
  • Verify cell configuration uses UIContentConfiguration, not deprecated textLabel (see references/cell-configuration.md)
  • Check list scroll performance — prefetching, cell reuse cleanup, reconfigureItems (see references/list-performance.md)
  • Verify navigation patterns — bar appearance all 4 slots, no concurrent transition crashes (see references/navigation-patterns.md)
  • Check animation correctness — API selection, PropertyAnimator state machine, constraint animation (see references/animation-patterns.md)
  • Audit memory management — [weak self], delegate ownership, Timer/CADisplayLink traps (see references/memory-management.md)
  • Check concurrency safety — Task lifecycle, cancellation in viewDidDisappear (see references/concurrency-main-thread.md)
  • If SwiftUI interop present — verify UIHostingController containment, sizingOptions (see references/uikit-swiftui-interop.md)
  • Check image loading — downsampling, cell reuse race condition (cancel/clear/verify) (see references/image-loading.md)
  • Verify keyboard handling — UIKeyboardLayoutGuide over manual notifications (see references/keyboard-scroll.md)
  • Check trait handling and accessibility — registerForTraitChanges, Dynamic Type, VoiceOver (see references/adaptive-appearance.md)
  • Validate modern API adoption and iOS 26+ availability handling (see references/modern-uikit-apis.md)

2) Improve existing UIKit code

  • Replace geometry work in viewDidLoad with viewIsAppearing (see references/view-controller-lifecycle.md)
  • Eliminate constraint churn — create once, toggle isActive or modify .constant (see references/auto-layout.md)
  • Migrate from legacy UITableViewDataSource to diffable data sources (see references/modern-collection-views.md)
  • Replace deprecated textLabel/detailTextLabel/imageView with UIContentConfiguration (see references/cell-configuration.md)
  • Replace reloadItems with reconfigureItems for in-place cell updates (see references/list-performance.md)
  • Fix navigation bar appearance — set all 4 appearance slots, use navigationItem not navigationBar (see references/navigation-patterns.md)
  • Improve animations — use PropertyAnimator for gestures, correct constraint animation pattern (see references/animation-patterns.md)
  • Fix retain cycles — add [weak self], cancel Tasks in viewDidDisappear, use block-based Timer (see references/memory-management.md)
  • Migrate GCD to Swift concurrency — replace DispatchQueue.main.async with Task (see references/concurrency-main-thread.md)
  • Suggest image downsampling when UIImage(data:) or full-resolution loading detected (as optional optimization, see references/image-loading.md)
  • Replace keyboard notification handling with UIKeyboardLayoutGuide (see references/keyboard-scroll.md)
  • Replace traitCollectionDidChange with registerForTraitChanges (see references/adaptive-appearance.md)
  • Adopt iOS 26 APIs where appropriate — Observation, updateProperties(),.flushUpdates (see references/modern-uikit-apis.md)

3) Implement new UIKit feature

  • Design data flow first: identify owned state, injected dependencies, and model layer
  • Set up view controller lifecycle correctly — one-time setup in viewDidLoad, geometry in viewIsAppearing (see references/view-controller-lifecycle.md)
  • Build Auto Layout with batch activation and zero churn (see references/auto-layout.md)
  • Use modern collection view stack: DiffableDataSource + CompositionalLayout + CellRegistration (see references/modern-collection-views.md)
  • Configure cells with UIContentConfiguration and configurationUpdateHandler (see references/cell-configuration.md)
  • Implement prefetching and proper cell reuse cleanup for lists (see references/list-performance.md)
  • Set up navigation with all 4 appearance slots and concurrent-transition guards (see references/navigation-patterns.md)
  • Choose correct animation API for the use case (see references/animation-patterns.md)
  • Use [weak self] in escaping closures, cancel Tasks in lifecycle methods (see references/memory-management.md)
  • Use @MainActor correctly, store Task references (see references/concurrency-main-thread.md)
  • If embedding SwiftUI — use full child VC containment for UIHostingController (see references/uikit-swiftui-interop.md)
  • Downsample images for display, handle cell reuse race condition (see references/image-loading.md)
  • Use UIKeyboardLayoutGuide for keyboard handling (see references/keyboard-scroll.md)
  • Support Dynamic Type, VoiceOver, dark mode from the start (see references/adaptive-appearance.md)
  • Gate iOS 26+ features with #available and provide sensible fallbacks (see references/modern-uikit-apis.md)

Core Guidelines

View Controller Lifecycle

  • Use viewDidLoad for one-time setup: subviews, constraints, delegates — NOT geometry
  • Use viewIsAppearing (back-deployed iOS 13+) for geometry-dependent work, trait-based layout, scroll-to-item
  • viewDidLayoutSubviews fires multiple times — use only for lightweight layer frame adjustments
  • viewWillAppear is limited to transition coordinator animations and balanced notification registration
  • Always call super in every lifecycle override
  • Child VC containment: addChildaddSubviewdidMove(toParent:) — in that exact order
  • Verify deallocation with deinit logging during development

Auto Layout

  • Always set translatesAutoresizingMaskIntoConstraints = false on programmatic views
  • Use NSLayoutConstraint.activate([]) — never individual .isActive = true
  • Create constraints once, toggle isActive or modify .constant — never remove and recreate
  • Never change priority from/to .required (1000) at runtime — use 999
  • Animate constraints: update constant → call layoutIfNeeded() inside animation block on superview
  • iOS 26+: use .flushUpdates option to simplify constraint animation
  • Avoid deeply nested UIStackViews in reusable cells

Collection Views & Data Sources

  • Use UICollectionViewDiffableDataSource with stable identifiers (UUID/database ID, not full model structs)
  • Use reconfigureItems for content updates, reloadItems only when cell type changes
  • Use applySnapshotUsingReloadData for initial population (bypasses diffing)
  • Use UICollectionViewCompositionalLayout for any non-trivial layout
  • Use UICollectionView.CellRegistration — no string identifiers, no manual casting
  • Use UIContentConfiguration for cell content and UIBackgroundConfiguration for cell backgrounds
  • Use configurationUpdateHandler for state-driven styling (selection, highlight)

Navigation

  • Configure all 4 UINavigationBarAppearance slots (standard, scrollEdge, compact, compactScrollEdge)
  • Set appearance on navigationItem (per-VC) in viewDidLoad, not on navigationBar in viewWillAppear
  • Use setViewControllers(_:animated:) for deep links — not sequential push calls
  • Guard against concurrent transitions — check transitionCoordinator before push/pop
  • Set prefersLargeTitles once on the bar; use largeTitleDisplayMode per VC

Animation

  • UIView.animate — simple one-shot animations; check finished in completion
  • UIViewPropertyAnimator — gesture-driven, interruptible; respect state machine (inactive → active → stopped)
  • CABasicAnimation — layer-only properties (cornerRadius, shadow, 3D transforms); set model value first
  • iOS 17+ spring API: UIView.animate(springDuration:bounce:) aligns with SwiftUI
  • Constraint animation: flush layout → update constant → animate layoutIfNeeded() on superview

Memory Management

  • Default to [weak self] in all escaping closures
  • Timer: use block-based API with [weak self], invalidate in viewWillDisappear
  • CADisplayLink: use weak proxy pattern (no block-based API available)
  • NotificationCenter: [weak self] in closure, remove observer in deinit
  • Nested closures: re-capture [weak self] in stored inner closures
  • Delegates: always weak var delegate: SomeDelegate? with AnyObject constraint
  • Verify deallocation with deinit — if never called, a retain cycle exists

Concurrency

  • UIViewController is @MainActor — all subclass methods are implicitly main-actor
  • Store Task references, cancel in viewDidDisappear — not deinit
  • Check Task.isCancelled before UI updates after await
  • Task.detached does NOT inherit actor isolation — explicit MainActor.run needed for UI
  • Never call DispatchQueue.main.sync from background — use await MainActor.run

UIKit–SwiftUI Interop

  • UIHostingController: full child VC containment (addChildaddSubviewdidMove), retain as stored property
  • sizingOptions =.intrinsicContentSize (iOS 16+) for Auto Layout containers
  • UIViewRepresentable: set mutable state in updateUIView, not makeUIView; guard against update loops
  • UIHostingConfiguration (iOS 16+) for SwiftUI content in collection view cells

Image Loading

  • Decoded bitmap size = width × height × 4 bytes (a 12MP photo = ~48MB RAM)
  • Downsample with ImageIO at display size — never load full bitmap and resize
  • iOS 15+: use byPreparingThumbnail(of:) or prepareForDisplay() for async decoding
  • Cell reuse: cancel Task in prepareForReuse, clear image, verify identity on completion

Keyboard & Scroll

  • Use UIKeyboardLayoutGuide (iOS 15+) — pin content bottom to view.keyboardLayoutGuide.topAnchor
  • iPad: set followsUndockedKeyboard = true for floating keyboards
  • Replace all manual keyboard notification handling with the layout guide

Adaptive Layout & Accessibility

  • Use registerForTraitChanges (iOS 17+) instead of deprecated traitCollectionDidChange
  • Dynamic Type: UIFont.preferredFont(forTextStyle:) + adjustsFontForContentSizeCategory = true
  • Dark mode: use semantic colors (.label, .systemBackground); re-resolve CGColor on trait changes
  • VoiceOver: set accessibilityLabel, accessibilityTraits, accessibilityHint on custom views
  • Use UIAccessibilityCustomAction for complex list item actions

Quick Reference

View Controller Lifecycle Method Selection

MethodUse For
viewDidLoadOne-time setup: subviews, constraints, delegates
viewIsAppearingGeometry-dependent work, trait-based layout, scroll-to-item
viewWillAppearTransition coordinator animations only
viewDidLayoutSubviewsLightweight layer frame adjustments (fires multiple times)
viewDidAppearStart animations, analytics, post-appearance work
viewWillDisappearCancel tasks, invalidate timers, save state
viewDidDisappearFinal cleanup, cancel background work

Animation API Selection

APIBest ForInteractiveOff Main Thread
UIView.animateSimple one-shot changesNoNo
UIViewPropertyAnimatorGesture-driven, interruptibleYesNo
CABasicAnimationLayer properties, 3D transformsLimitedYes (Render Server)

Deprecated → Modern API Replacements

Deprecated / LegacyModern ReplacementSince
traitCollectionDidChangeregisterForTraitChanges(_:handler:)iOS 17
Keyboard notificationsUIKeyboardLayoutGuideiOS 15
cell.textLabel / detailTextLabelUIListContentConfigurationiOS 14
register + string dequeueUICollectionView.CellRegistrationiOS 14
reloadItems on snapshotreconfigureItemsiOS 15
barTintColor / isTranslucentUINavigationBarAppearance (4 slots)iOS 13
UICollectionViewFlowLayout (complex)UICollectionViewCompositionalLayoutiOS 13
Manual layoutIfNeeded() in animations.flushUpdates optioniOS 26
Legacy app lifecycleUIScene + SceneDelegateMandatory iOS 26
ObservableObject + manual invalidation@Observable + UIObservationTrackingEnablediOS 18

Review Checklist

View Controller Lifecycle

  • viewDidLoad contains NO geometry-dependent work
  • Geometry/trait work is in viewIsAppearing, not viewWillAppear
  • Every lifecycle override calls super
  • Child VC uses correct containment sequence
  • deinit is implemented for leak verification during development

Auto Layout

  • translatesAutoresizingMaskIntoConstraints = false on all programmatic views
  • Constraints activated via NSLayoutConstraint.activate([])
  • No constraint removal/recreation — using isActive toggle or .constant modification
  • No priority changes from/to .required (1000) at runtime
  • No setNeedsLayout() inside layoutSubviews or viewDidLayoutSubviews (infinite loop)
  • Constraint identifiers set for debugging

Collection Views

  • Using diffable data source with stable identifiers (not full model structs)
  • reconfigureItems for content updates, not reloadItems
  • CellRegistration instead of string-based register/dequeue
  • UIContentConfiguration instead of deprecated cell properties
  • No duplicate identifiers in snapshot (BUG_IN_CLIENT crash)
  • Self-sizing cells have unambiguous top-to-bottom constraint chain

Navigation

  • All 4 UINavigationBarAppearance slots configured
  • Appearance set on navigationItem in viewDidLoad, not navigationBar in viewWillAppear
  • Concurrent transition guard in place
  • prefersLargeTitles set once; largeTitleDisplayMode per VC

Animation

  • Correct API chosen for use case (animate vs PropertyAnimator vs CA)
  • UIViewPropertyAnimator state machine respected
  • Constraint animation uses correct pattern (flush → update → animate)
  • CAAnimation sets model value before adding animation
  • Completion handlers check finished parameter

Memory Management

  • [weak self] in all escaping closures
  • Timers use block-based API with [weak self]; invalidated in viewWillDisappear
  • Task references stored and cancelled in viewDidDisappear
  • CADisplayLink uses weak proxy pattern
  • Delegates declared as weak var on AnyObject-constrained protocol
  • No strong self re-capture in nested stored closures

Concurrency

  • Task.isCancelled checked after await before UI updates
  • No Task.detached for UI work without explicit MainActor.run
  • No redundant @MainActor on UIViewController subclasses (already inherited)
  • No DispatchQueue.main.sync from background

Image Loading

  • Images downsampled to display size (not loaded at full resolution)
  • Cell image loading: cancel in prepareForReuse, clear image, verify identity
  • NSCache sized by decoded bitmap bytes, not file size

UIKit–SwiftUI Interop

  • UIHostingController retained as stored property (not local variable)
  • UIHostingController uses full child VC containment (addChildaddSubviewdidMove)
  • updateUIView guards against infinite update loops with equality checks

Keyboard

  • Using UIKeyboardLayoutGuide (iOS 15+) instead of keyboard notifications
  • iPad: followsUndockedKeyboard = true on the layout guide

Adaptive & Accessibility

  • registerForTraitChanges (iOS 17+) instead of traitCollectionDidChange
  • Dynamic Type: preferredFont + adjustsFontForContentSizeCategory = true
  • CGColor properties re-resolved on trait changes (layer.borderColor, shadowColor)
  • Custom views have accessibilityLabel and accessibilityTraits
  • UIAccessibilityCustomAction for complex list item actions

Modern APIs (iOS 26+)

  • #available guards with sensible fallbacks for iOS 26+ features
  • UIScene lifecycle adopted (mandatory for iOS 26 SDK)
  • UIObservationTrackingEnabled considered for iOS 18+ targets

References

  • references/view-controller-lifecycle.md — Lifecycle ordering, viewIsAppearing, child VC containment
  • references/auto-layout.md — Batch activation, constraint churn, priority, animation, debugging
  • references/modern-collection-views.md — Diffable data sources, compositional layout, CellRegistration
  • references/cell-configuration.md — UIContentConfiguration, UIBackgroundConfiguration, configurationUpdateHandler
  • references/list-performance.md — Prefetching, cell reuse, reconfigureItems, scroll performance
  • references/navigation-patterns.md — Bar appearance, concurrent transitions, large titles, deep links
  • references/animation-patterns.md — UIView.animate, UIViewPropertyAnimator, CAAnimation, springs
  • references/memory-management.md — Retain cycles, [weak self], Timer/CADisplayLink/nested closure traps
  • references/concurrency-main-thread.md — @MainActor, Task lifecycle, Swift 6, GCD migration
  • references/uikit-swiftui-interop.md — UIHostingController, UIViewRepresentable, sizing, state bridging
  • references/image-loading.md — Downsampling, decoded bitmap math, cell reuse race condition
  • references/keyboard-scroll.md — UIKeyboardLayoutGuide, scroll view insets, iPad floating keyboard
  • references/adaptive-appearance.md — Trait changes, Dynamic Type, dark mode, VoiceOver, accessibility
  • references/modern-uikit-apis.md — Observation framework, updateProperties(),.flushUpdates, UIScene, Liquid Glass

Philosophy

This skill focuses on facts and best practices, not architectural opinions:

  • We don't enforce specific architectures (e.g., MVVM, VIPER, Coordinator)
  • We do encourage separating business logic for testability
  • We optimize for correctness first, then performance
  • We follow Apple's documented APIs and Human Interface Guidelines
  • We use "suggest" or "consider" for optional optimizations
  • We use "always" or "never" only for correctness issues

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.01%
按下载量换算180

Claude

29.76%
按下载量换算149

Cursor

16.34%
按下载量换算82

Gemini CLI

8.28%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills