swiftship/internal/skills/data/ui/forms-and-input/SKILL.md
Forms and input: TextField, Picker, Toggle, validation, keyboard. Use when implementing UI patterns related to forms and input.
npx skillsauth add abdullah4ai/apple-developer-toolkit forms-and-inputInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
struct SettingsView: View {
@State private var username = ""
@State private var notificationsEnabled = true
@State private var selectedColor = Color.blue
var body: some View {
Form {
Section("Profile") {
TextField("Username", text: $username)
ColorPicker("Accent Color", selection: $selectedColor)
}
Section("Preferences") {
Toggle("Notifications", isOn: $notificationsEnabled)
}
}
}
}
TextField("Email", text: $email)
.textContentType(.emailAddress)
.keyboardType(.emailAddress)
.autocorrectionDisabled()
.textInputAutocapitalization(.never)
SecureField("Password", text: $password)
.textContentType(.password)
@State private var email = ""
TextField("Email", text: $email)
.onChange(of: email) { _, newValue in
isEmailValid = newValue.contains("@")
}
.overlay(alignment: .trailing) {
if !email.isEmpty {
Image(systemName: isEmailValid ? "checkmark.circle.fill" : "xmark.circle.fill")
.foregroundStyle(isEmailValid ? .green : .red)
}
}
@State private var selectedTab = 0
Picker("View", selection: $selectedTab) {
Text("List").tag(0)
Text("Grid").tag(1)
}
.pickerStyle(.segmented)
Picker("Sort By", selection: $sortOrder) {
Text("Name").tag(SortOrder.name)
Text("Date").tag(SortOrder.date)
Text("Size").tag(SortOrder.size)
}
DatePicker("Due Date", selection: $dueDate, displayedComponents: [.date])
.datePickerStyle(.compact)
Stepper("Quantity: \(quantity)", value: $quantity, in: 1...99)
Slider(value: $volume, in: 0...100) {
Text("Volume")
} minimumValueLabel: {
Image(systemName: "speaker")
} maximumValueLabel: {
Image(systemName: "speaker.wave.3")
}
struct CreateItemView: View {
@Environment(\.dismiss) private var dismiss
@State private var name = ""
@State private var isSubmitting = false
var body: some View {
NavigationStack {
Form {
TextField("Name", text: $name)
}
.navigationTitle("New Item")
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") { dismiss() }
}
ToolbarItem(placement: .confirmationAction) {
Button("Save") {
Task { await submit() }
}
.disabled(name.isEmpty || isSubmitting)
}
}
}
}
private func submit() async {
isSubmitting = true
// Save logic
dismiss()
}
}
testing
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.