/apple-apps:configuring-ios-contentfrom Apple Apps
Configures UIKit cell content, backgrounds, empty states, and SwiftUI hosting. Guides cell registration, configuration updates, reuse, and legacy cell-label migration for iOS projects.
Ships in Apple Apps. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill for modern cell and content-view configuration in UIKit projects. Inspect and preserve the selected compiler, language mode, and deployment target. The examples use iOS 16+; keep existing older-runtime paths when the project supports them. UIKit view updates belong on the main actor.
UIHostingConfiguration for cell content on iOS 16+; preserve a compatible path below that floor.UIContentUnavailableConfiguration, with #available(iOS 17.0, *) when the target remains iOS 16.modeling-swift-types-for-correctness's swift-feature-status.md when the swift plugin is installed and verify the specific API's availability and behavior.cell.defaultContentConfiguration() or UIListContentConfiguration, plus UIBackgroundConfiguration and UICellAccessory.UIHostingConfiguration, especially when the content is easier to express as SwiftUI.UIContentUnavailableConfiguration on iOS 17+, with an iOS 16 fallback only when necessary.UIContentConfiguration struct and a separate UIView & UIContentView class.configurationState, async task cancellation, prepareForReuse, focus/drag/drop behavior, or truly cell-owned views. Do not subclass cells just to set labels and images.cell.contentConfiguration = content.cell.defaultContentConfiguration() over UIListContentConfiguration.cell() inside cells because the default is context-aware.configurationUpdateHandler or updateConfiguration(using:) for state-dependent content/background updates. Rebuild a fresh configuration in the handler..updated(for: state) before applying custom overrides.setNeedsUpdateConfiguration() from inside configurationUpdateHandler, updateConfiguration(using:), layoutSubviews, or an apply(configuration:) method.textLabel, detailTextLabel, or imageView cell APIs with contentConfiguration for the same cell.snapshot.reconfigureItems(_:), then apply the snapshot, for content changes that keep item identity the same; use snapshot inserts/deletes/moves for identity changes.indexPath in action closures. Capture a stable item ID, or query the current index path at action time.UIContentConfiguration does not require Hashable or Equatable. Add equality only when there is a concrete reason.updated(for:) or makeContentView().apply: text, attributed text, image, hidden flags, colors, fonts, alpha, background, accessibility, actions, and layout margins as relevant.adjustsFontForContentSizeCategory, numberOfLines = 0 where appropriate, directional margins, and semantic colors.UIHostingConfiguration, keep durable state in the model or observable object. Do not rely on cell-local @State to survive reuse or reconfiguration.UIHostingController, not UIHostingConfiguration, for arbitrary UIKit container views outside cell/content-configuration contexts.private func configure(_ cell: UICollectionViewListCell, with item: Item, state: UICellConfigurationState) {
var content = cell.defaultContentConfiguration().updated(for: state)
content.text = item.title
content.secondaryText = item.subtitle
content.image = item.symbolImage
content.textProperties.font = .preferredFont(forTextStyle: .body)
content.textProperties.adjustsFontForContentSizeCategory = true
content.secondaryTextProperties.color = .secondaryLabel
cell.contentConfiguration = content
var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state)
background.backgroundColor = state.isSelected ? .secondarySystemGroupedBackground : .systemGroupedBackground
cell.backgroundConfiguration = background
}
let registration = UICollectionView.CellRegistration<UICollectionViewListCell, Item.ID> { [weak self] cell, _, id in
cell.configurationUpdateHandler = { [weak self] cell, state in
guard let self,
let cell = cell as? UICollectionViewListCell,
let item = self.item(for: id)
else { return }
self.configure(cell, with: item, state: state)
}
cell.setNeedsUpdateConfiguration()
}
cell.configurationUpdateHandler = { [weak self] cell, state in
guard let self, let item = self.item(for: itemID) else { return }
cell.contentConfiguration = UIHostingConfiguration {
ItemRow(item: item, isSelected: state.isSelected, isHighlighted: state.isHighlighted) { [weak self] in
self?.delete(itemID)
}
}
.margins(.vertical, 8)
.margins(.horizontal, 16)
}
struct UserRowContentConfiguration: UIContentConfiguration {
var id: User.ID
var title: String
var subtitle: String?
var image: UIImage?
var imageIdentifier: AnyHashable?
var onAccessoryTap: ((User.ID) -> Void)?
fileprivate var isSelected = false
fileprivate var isHighlighted = false
fileprivate var isDisabled = false
@MainActor
func makeContentView() -> any UIView & UIContentView {
UserRowContentView(configuration: self)
}
func updated(for state: any UIConfigurationState) -> Self {
var updated = self
if let state = state as? UICellConfigurationState {
updated.isSelected = state.isSelected
updated.isHighlighted = state.isHighlighted
updated.isDisabled = state.isDisabled
} else if let state = state as? UIViewConfigurationState {
updated.isSelected = state.isSelected
updated.isHighlighted = state.isHighlighted
updated.isDisabled = state.isDisabled
}
return updated
}
}
apply or layoutSubviews creates duplicate constraints and layout churn.setNeedsUpdateConfiguration() from an update callback creates loops.The imported REFERENCE.md includes historical Swift 6/iOS 16 assumptions; adapt those templates to the project settings established above rather than treating them as upgrade requirements.
For complete templates, custom state keys, content-unavailable examples, diffable-data-source guidance, and review checklists, read REFERENCE.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kylehughes/agent-plugins-for-making-good-software --plugin apple-apps7 skills in this plugin
/implementing-app-intentsBuild or debug App Intents, entities, queries, and system integrations. Use proactively for Siri, Shortcuts, Spotlight, widgets, controls, or Apple Intelligence integration./instrumenting-accessibility-identifiersAdd or audit typed accessibility identifiers and XCUITest selectors in SwiftUI or UIKit. Use proactively for automation contracts and selector migration; not a general VoiceOver audit./localizing-stringsLocalize Apple-platform UI text with string catalogs and bundle-aware APIs. Use proactively for new user-facing strings, plurals, interpolation, or hardcoded-string extraction./presenting-ios-modalsBuild or review SwiftUI and UIKit modal sheets, navigation chrome, button roles, detents, and dismissal. Use proactively for modal flows; not ordinary navigation or general styling./recording-ios-simulator-videosRecord and compress iOS Simulator video for UI tests, bug reproductions, or PR demos. Use when a video artifact is needed; not screenshots or physical-device capture./simplifying-apple-platform-codeSimplify Swift and Apple-platform code while preserving SDK, lifecycle, concurrency, and deployment contracts. Use proactively for requested cleanup with simplifying-code when available.Other plugins' skills for the same job