Inspector 检查器 macos

Slides

Fill

Border

Shadow

标本可交互 —— 点点看。Specimen is live — try it.

Anatomy — every part, named解剖 —— 每个部件的名字

  1. 1 Inspector column检查器栏 View.inspector(isPresented:content:)

    “The properties panel on the right” is the inspector column.

    “右边那个属性面板”就是检查器栏。

    Prompt fragmentPrompt 片段

    a trailing inspector column created with View.inspector(isPresented:content:), beside rather than over the main content

    用 View.inspector(isPresented:content:) 创建的尾侧检查器栏,位于主内容旁边而不是覆盖其上

  2. 2 Inspector section disclosure检查器分节披露控件 DisclosureGroup

    “The little arrow that folds a group of settings” is an inspector section disclosure.

    “能折叠一组设置的小箭头”就是检查器的分节披露控件。

    Prompt fragmentPrompt 片段

    a DisclosureGroup section disclosure inside the inspector, with its chevron aligned to the section heading

    检查器内部的 DisclosureGroup 分节披露控件,箭头与分节标题对齐

  3. 3 Inspector column divider检查器栏分隔线 NSSplitViewItem

    “The thin line you drag to resize the properties panel” is the inspector column divider.

    “拖动就能调整属性面板宽度的那条细线”就是检查器栏分隔线。

    Prompt fragmentPrompt 片段

    the resizable divider before the trailing NSSplitViewItem inspector column

    尾侧 NSSplitViewItem 检查器栏前面那条可拖拽的分隔线

Prompt — paste into your agentPrompt —— 直接粘贴给你的代理

Put these selection-specific controls in an Inspector using SwiftUI View.inspector(isPresented:content:) (macOS 14+), as a collapsible right-hand column with a sensible inspectorColumnWidth. The inspector must update with the selected object without replacing the main content.

用 SwiftUI View.inspector(isPresented:content:)(macOS 14+)把这些随选中项变化的控件放进检查器,做成右侧可折叠的栏,并设置合理的 inspectorColumnWidth。检查器必须跟随选中对象更新内容,而不是替换主内容。

Debug prompt — when it misbehaves调试 Prompt —— 当它不听话时

Debug my macOS inspector (SwiftUI View.inspector(isPresented:), NSSplitViewItem(inspectorWithViewController:)). Rule out: the inspector auto-presenting as a sheet on narrow windows — that is the built-in adaptive behavior; the toggle binding out of sync because the user can also close it by dragging; min/ideal widths forcing a collapse on window resize; inspector content not tracking the current selection. The symptom:

调试我的 macOS 检查器(SwiftUI View.inspector(isPresented:)、NSSplitViewItem(inspectorWithViewController:))。逐一排除:窗口变窄时检查器自动以 sheet 形式弹出——这是内建的自适应行为;开关绑定不同步,因为用户也能拖拽把它关掉;min/ideal 宽度在窗口缩放时强制折叠了它;检查器内容没有跟随当前选中项。症状是:

In code代码里叫什么

Framework框架Symbol符号Note说明
SwiftUI View.inspector(isPresented:content:) macOS 14+macOS 14+
SwiftUI View.inspectorColumnWidth(min:ideal:max:)
AppKit NSSplitViewController common foundation for a classic trailing inspector经典尾侧检查器的常用基础
AppKit NSSplitViewItem

See also相关词条