swiftui
SwiftUI framework for building user interfaces
What this skill does
# SwiftUI Skill
## When to Use This Skill
Use this skill when:
- Building user interfaces with SwiftUI
- Working with SwiftUI views, modifiers, and layouts
- Implementing state management with @State, @Binding, @ObservableObject
- Creating animations and transitions
- Implementing navigation with NavigationStack, NavigationLink, TabView
- Working with data flow patterns (@Environment, @EnvironmentObject)
- Using SwiftUI controls (Button, TextField, Picker, etc.)
- Building cross-platform apps for iOS, macOS, watchOS, tvOS, visionOS
## Description
Complete SwiftUI framework documentation covering views, modifiers, layout, state management, animations, navigation, data flow, and all SwiftUI APIs for iOS, macOS, watchOS, tvOS, and visionOS.
## Quick Reference
### Core Components
### Accessibility
- `AccessibilityTraits`
### Animations
- `Animation`
- `AnyTransition`
- `Transition`
### Api Reference
- `Capsule`
- `Circle`
- `Commands`
- `ConfirmationDialog`
- `DisclosureGroup`
- `Ellipse`
- `ForEach`
- `Form`
- `FullScreenCover`
- `Gauge`
- `GeometryProxy`
- `GeometryReader`
- `GroupBox`
- `ImmersiveSpace`
- `List`
- `Menu`
- `MenuBarExtra`
- `ObservedObject`
- `OutlineGroup`
- `Published`
- `Rectangle`
- `RoundedRectangle`
- `Section`
- `SecureField`
- `SwiftUI`
- `Toolbar`
- `ToolbarItem`
- `ToolbarItemGroup`
### App Structure
- `DocumentGroup`
- `Scene`
- `Settings`
- `WindowGroup`
### Controls
- `Button`
- `DatePicker`
- `Picker`
- `Slider`
- `Stepper`
- `Toggle`
### Data Flow
- `FocusedSceneValue`
- `PreferenceKey`
### Drawing
- `Canvas`
- `Path`
### Essentials
- `App`
- `AppStorage`
### Gestures
- `DigitalCrownRotationalSensitivity`
- `DragGesture`
- `LongPressGesture`
- `MagnificationGesture`
- `RotationGesture`
- `TapGesture`
### Layout
- `Divider`
- `Grid`
- `GridRow`
- `HStack`
- `LazyHGrid`
- `LazyHStack`
- `LazyVGrid`
- `LazyVStack`
- `NavigationStack`
- `Spacer`
- `VStack`
- `ZStack`
### Navigation
- `Alert`
- `Link`
- `NavigationLink`
- `NavigationPath`
- `Popover`
- `Sheet`
- `Table`
- `TableColumn`
- `WKInterfaceObjectRepresentable`
### State Management
- `Binding`
- `Environment`
- `EnvironmentObject`
- `FocusState`
- `Observable`
- `ObservableObject`
- `SceneStorage`
- `State`
- `StateObject`
### Views
- `AccessibilityLabel`
- `Color`
- `ColorPicker`
- `ContextMenu`
- `Image`
- `Label`
- `NSViewControllerRepresentable`
- `NSViewRepresentable`
- `PreviewProvider`
- `ProgressView`
- `RealityView`
- `ScrollView`
- `Shape`
- `TabView`
- `Text`
- `TextEditor`
- `TextField`
- `TimelineView`
- `UIViewControllerRepresentable`
- `UIViewRepresentable`
- `View`
- `ViewModifier`
## Key Concepts
### Platform Support
- iOS 26.0+
- iPadOS 26.0+
- macOS 26.0+
- Mac Catalyst 26.0+
- visionOS 26.0+
### On-Device AI
All models run entirely on-device, ensuring privacy and offline capability.
## Usage Guidelines
1. Check model availability before use
2. Define clear instructions for the model's behavior
3. Use guided generation for structured outputs
4. Implement tool calling for dynamic capabilities
5. Handle errors appropriately
## Navigation
See the `references/` directory for detailed API documentation organized by category:
- `references/accessibility.md` - Accessibility
- `references/animations.md` - Animations
- `references/api_reference.md` - Api Reference
- `references/app_structure.md` - App Structure
- `references/controls.md` - Controls
- `references/data_flow.md` - Data Flow
- `references/drawing.md` - Drawing
- `references/essentials.md` - Essentials
- `references/gestures.md` - Gestures
- `references/layout.md` - Layout
- `references/navigation.md` - Navigation
- `references/state_management.md` - State Management
- `references/view_modifiers.md` - View Modifiers (18 modifiers including .sheet(), .frame(), .animation(), etc.)
- `references/views.md` - Views
## Best Practices
- **Prompting**: Be specific and clear in your prompts
- **Instructions**: Define the model's behavior upfront
- **Safety**: Enable guardrails for sensitive content
- **Localization**: Check supported languages for your use case
- **Performance**: Use prewarm() for better response times
- **Streaming**: Use streamResponse() for real-time user feedback
## Common Patterns
### Basic Session
```swift
let model = SystemLanguageModel(useCase: .general)
let session = LanguageModelSession(model: model)
let response = try await session.respond(to: Prompt("Your question"))
```
### Guided Generation
```swift
struct Recipe: Generable {
let title: String
let ingredients: [String]
}
let recipe = try await session.respond(
generating: Recipe.self,
prompt: Prompt("Create a pasta recipe")
)
```
### Tool Calling
```swift
struct WeatherTool: Tool {
func call(arguments: String) async throws -> String {
// Fetch weather data
}
}
let session = LanguageModelSession(
model: model,
tools: [WeatherTool()]
)
```
## Reference Documentation
For complete API details, see the categorized documentation in the `references/` directory.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.