From ios-swift-skills
Guides SwiftUI development for declarative UIs on Apple platforms, covering state management, SF Symbols integration, toolbars, accessibility, performance best practices, and code examples.
npx claudepluginhub fal3/claude-skills-collection --plugin ios-swift-skillsThis skill uses the workspace's default tool permissions.
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.
Provides best practices and examples for SwiftUI views/components: navigation, custom modifiers, responsive stacks/grids, @State/@Binding management. Use for iOS UI creation/refactoring.
Provides SwiftUI patterns for state management (@State/@Binding/@ObservableObject), view composition, Observable protocol, ViewModifiers, and declarative UI in iOS/macOS apps.
Applies SwiftUI UI patterns for navigation, sheets, async state, reusable screens, app wiring, and components. Use when creating or refactoring SwiftUI views, flows, or projects.
Share bugs, ideas, or general feedback.
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("@")
}
}