swiftui-programming-skill
Expertise in SwiftUI for building declarative user interfaces, including SF Symbols integration and best practices.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Expertise in SwiftUI for building declarative user interfaces, including SF Symbols integration and best practices.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Expert guide for Apple's modern Speech framework (macOS 26+, iOS 26+) featuring SpeechAnalyzer and SpeechTranscriber for on-device speech-to-text transcription.
Strategies for developing apps that work across multiple Apple platforms, including adaptive layouts and multi-view implementations.
Best practices for implementing accessibility features in iOS apps, including VoiceOver support, Dynamic Type, and Human Interface Guidelines compliance.
Creating animations and graphics using SwiftUI Canvas, Core Animation, and Lottie integration for engaging iOS app experiences.
Detecting and fixing memory leaks and retain cycles in Swift apps using Instruments and best practices.
Guide for building iOS apps using Swift 6, iOS 18+, SwiftUI, SwiftData, and modern concurrency patterns. Use when writing Swift/iOS code, designing app architecture, or modernizing legacy patterns. Prevents outdated patterns like Core Data, ObservableObject, DispatchQueue, and NavigationView.
| name | SwiftUI Programming Skill |
| description | Expertise in SwiftUI for building declarative user interfaces, including SF Symbols integration and best practices. |
| version | 1 |
| activation | Activate for queries on SwiftUI development, declarative UI building, SF Symbols usage, or SwiftUI component creation. |
This skill provides comprehensive guidance on developing user interfaces using SwiftUI, Apple's modern framework for building apps across all Apple platforms. It emphasizes declarative programming, state management, and integration with system features like SF Symbols.
Declarative Syntax: Use SwiftUI's declarative approach to describe what the UI should look like, not how to build it.
State Management: Leverage @State, @ObservedObject, @EnvironmentObject for managing view state.
Composition: Build complex views by composing simpler views.
Accessibility: Always consider accessibility features from the start.
Performance: Use appropriate modifiers and avoid unnecessary view updates.
SF Symbols: Utilize Apple's symbol library for consistent iconography.
@AppStorage for simple user preferences.User Prompt: "Create a SwiftUI view with a navigation bar and toolbar items using SF Symbols."
Expected Output:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
Text("Hello, World!")
.navigationTitle("My App")
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button(action: {
// Action for leading button
}) {
Image(systemName: "line.horizontal.3")
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
// Action for trailing button
}) {
Image(systemName: "plus")
}
}
}
}
}
}
User Prompt: "Show how to create a toggle button that changes the background color using SwiftUI."
Expected Output:
import SwiftUI
struct ToggleView: View {
@State private var isOn = false
var body: some View {
ZStack {
(isOn ? Color.blue : Color.gray)
.edgesIgnoringSafeArea(.all)
VStack {
Text(isOn ? "Light Mode" : "Dark Mode")
.foregroundColor(.white)
.font(.largeTitle)
Toggle("Toggle Mode", isOn: $isOn)
.padding()
.toggleStyle(SwitchToggleStyle(tint: .white))
}
}
}
}
User Prompt: "How can I display an SF Symbol with custom colors and effects in SwiftUI?"
Expected Output:
import SwiftUI
struct SymbolView: View {
var body: some View {
VStack(spacing: 20) {
Image(systemName: "star.fill")
.font(.system(size: 50))
.foregroundColor(.yellow)
Image(systemName: "heart.fill")
.font(.system(size: 50))
.foregroundColor(.red)
.shadow(radius: 5)
Image(systemName: "moon.fill")
.font(.system(size: 50))
.foregroundColor(.blue)
.background(Circle().fill(Color.white).shadow(radius: 3))
.clipShape(Circle())
}
}
}
User Prompt: "Generate a SwiftUI list that navigates to detail views."
Expected Output:
import SwiftUI
struct Item: Identifiable {
let id = UUID()
let name: String
}
struct ListView: View {
let items = [Item(name: "Item 1"), Item(name: "Item 2"), Item(name: "Item 3")]
var body: some View {
NavigationView {
List(items) { item in
NavigationLink(destination: DetailView(item: item)) {
Text(item.name)
}
}
.navigationTitle("Items")
}
}
}
struct DetailView: View {
let item: Item
var body: some View {
Text("Detail for \(item.name)")
.navigationTitle(item.name)
}
}
User Prompt: "Create a SwiftUI form for user input with basic validation."
Expected Output:
import SwiftUI
struct FormView: View {
@State private var name = ""
@State private var email = ""
@State private var isValid = false
var body: some View {
NavigationView {
Form {
Section(header: Text("Personal Information")) {
TextField("Name", text: $name)
TextField("Email", text: $email)
.keyboardType(.emailAddress)
.autocapitalization(.none)
}
Section {
Button("Submit") {
// Submit action
}
.disabled(!isValid)
}
}
.navigationTitle("User Form")
.onChange(of: name) { _ in validateForm() }
.onChange(of: email) { _ in validateForm() }
}
}
private func validateForm() {
isValid = !name.isEmpty && email.contains("@")
}
}