Agent skills for iOS, iPadOS, Swift, SwiftUI, and modern Apple framework development.
71
89%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Use this pattern for a scalable, multi-platform tab architecture with:
AppTab enum defines identity, labels, icons, and content builder.SidebarSections enum groups tabs for sidebar sections.AppView owns the TabView and selection binding, and routes tab changes through updateTab.Use this when tab selection needs side effects, like intercepting a special tab to perform an action instead of changing selection.
@MainActor
struct AppView: View {
@Binding var selectedTab: AppTab
var body: some View {
TabView(selection: .init(
get: { selectedTab },
set: { updateTab(with: $0) }
)) {
ForEach(availableSections) { section in
TabSection(section.title) {
ForEach(section.tabs) { tab in
Tab(value: tab) {
tab.makeContentView(
homeTimeline: $timeline,
selectedTab: $selectedTab,
pinnedFilters: $pinnedFilters
)
} label: {
tab.label
}
.tabPlacement(tab.tabPlacement)
}
}
.tabPlacement(.sidebarOnly)
}
}
}
private func updateTab(with newTab: AppTab) {
if newTab == .post {
// Intercept special tabs (compose) instead of changing selection.
presentComposer()
return
}
selectedTab = newTab
}
}Use this when selection is purely state-driven.
@MainActor
struct AppView: View {
@Binding var selectedTab: AppTab
var body: some View {
TabView(selection: $selectedTab) {
ForEach(availableSections) { section in
TabSection(section.title) {
ForEach(section.tabs) { tab in
Tab(value: tab) {
tab.makeContentView(
homeTimeline: $timeline,
selectedTab: $selectedTab,
pinnedFilters: $pinnedFilters
)
} label: {
tab.label
}
.tabPlacement(tab.tabPlacement)
}
}
.tabPlacement(.sidebarOnly)
}
}
}
}AppTab with makeContentView(...).Tab(value:) with selection binding for state-driven tab selection.updateTab to handle special tabs and scroll-to-top behavior.TabSection + .tabPlacement(.sidebarOnly) for sidebar structure..tabPlacement(.pinned) in AppTab.tabPlacement for a single pinned tab; this is commonly used for iOS 26 .searchable tab content, but can be used for any tab.SidebarSections handles dynamic data tabs.AppTab.anyTimelineFilter(filter:) wraps dynamic tabs in a single enum case.iOS 26 expands the Tab API with minimize behavior, roles, and accessory placements.
TabView(selection: $selectedTab) {
// tabs
}
.tabBarMinimizeBehavior(.onScrollDown) // iPhone onlyTabBarMinimizeBehavior values:
.automatic -- determine behavior from context.onScrollDown -- minimize when user scrolls down (iPhone only).onScrollUp -- minimize when user scrolls up (iPhone only).never -- never minimize the tab barReplace the tab bar with a search field when the search tab is active:
Tab(role: .search) {
SearchView()
}TabView {
// tabs
}
.tabViewSidebarHeader { SidebarHeaderView() }
.tabViewSidebarFooter { SidebarFooterView() }
.tabViewSidebarBottomBar { BottomBarView() }Use TabViewBottomAccessoryPlacement for content below the tab bar:
TabView {
// tabs
}
.tabViewBottomAccessory { NowPlayingBar() }@Observable services.@Observable objects inside other @Observable objects.AppTab.id values are stable; dynamic cases should hash on stable IDs.Tab(value:) with TabView(selection:) over the older .tabItem { } API for typed tab selection.tabBarMinimizeBehavior only works on iPhone; it has no effect on iPad or Mac.skills
accessorysetupkit
references
activitykit
references
adattributionkit
references
alarmkit
references
app-clips
app-intents
references
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
references
audioaccessorykit
references
authentication
references
avkit
references
background-processing
references
browserenginekit
references
callkit
references
carplay
references
cloudkit
references
contacts-framework
references
core-bluetooth
references
core-data
core-motion
references
core-nfc
references
coreml
references
cryptokit
references
cryptotokenkit
references
debugging-instruments
device-integrity
references
dockkit
references
energykit
references
eventkit
references
financekit
references
focus-engine
gamekit
references
healthkit
references
homekit
references
ios-accessibility
ios-localization
ios-networking
ios-simulator
references
mapkit
metrickit
references
musickit
references
natural-language
references
paperkit
references
passkit
references
pdfkit
references
pencilkit
references
permissionkit
references
photokit
push-notifications
realitykit
references
relevancekit
references
scenekit
references
sensorkit
references
speech-recognition
spritekit
references
storekit
swift-api-design-guidelines
swift-architecture
swift-charts
references
swift-codable
swift-concurrency
swift-formatstyle
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-uikit-interop
swiftui-webkit
tabletopkit
references
tipkit
references
vision-framework
weatherkit
references
widgetkit
references