ios-design

This skill should be used when the user asks to "audit iOS code", "review SwiftUI", "check HIG compliance", "critique SwiftUI design", "verify Human Interface Guidelines", "audit SwiftUI screen", "review iOS UI", "check Apple guidelines", "validate iOS design", "fix SwiftUI anti-patterns", "improve SwiftUI performance", "review iOS screen", "audit Swift UI", "check safe areas", "verify accessibility iOS", or mentions "Human Interface Guidelines", "HIG", "SwiftUI", "iOS UI", "SwiftUI patterns", "view identity", "property wrappers", "iOS accessibility", "WCAG iOS", "Dynamic Type". This skill should also be used when the user reports symptoms like "Why is my list slow?", "Scroll stutters", "Make this feel like a native iOS app", "Safe area problems", "Build a settings screen", "SwiftUI performance", "View keeps updating", or "Memory leak in my view". Provides comprehensive Apple HIG specifications, SwiftUI anti-patterns database, typography scale, semantic colors, safe areas, and severity-based audit checklists.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ios-design" with this command: npx skills add moonlightbyte/kiln/moonlightbyte-kiln-ios-design

iOS Design Skill

Expert knowledge of Apple Human Interface Guidelines for SwiftUI applications. This skill enforces design excellence, accessibility compliance, and iOS-native feel.

Core Principles

1. iOS Native Feel

  • Use system colors and semantic tokens
  • Follow Dynamic Type for text scaling
  • Respect Safe Areas and notches
  • Support both light and dark mode

2. Accessibility First

  • Minimum 44x44pt touch targets
  • 4.5:1 contrast ratio for normal text
  • Proper accessibilityLabel on all interactive elements
  • Support Dynamic Type up to AX5 (largest accessibility sizes)

3. SwiftUI Best Practices

  • Use correct property wrappers (@State, @StateObject, @ObservedObject)
  • Prefer declarative patterns
  • Avoid AnyView type erasure
  • Provide stable IDs in ForEach

Typography Scale (11 Styles)

StyleSize (Default)WeightUse Case
.largeTitle34ptRegularHero headlines
.title28ptRegularPage titles
.title222ptRegularSection headers
.title320ptRegularSubsection headers
.headline17ptSemiboldEmphasized body
.body17ptRegularMain content
.callout16ptRegularSecondary content
.subheadline15ptRegularSupporting text
.footnote13ptRegularMetadata
.caption12ptRegularCaptions
.caption211ptRegularSmall labels

Usage Pattern

// GOOD - System text styles
Text("Welcome")
    .font(.largeTitle)

// BAD - Hardcoded sizes
Text("Welcome")
    .font(.system(size: 34))

Dynamic Type Support

// Automatic scaling with system styles
Text("Body text")
    .font(.body)

// Custom sizes that scale
@ScaledMetric(relativeTo: .body) var iconSize: CGFloat = 24

Image(systemName: "star.fill")
    .frame(width: iconSize, height: iconSize)

Color System

Semantic Colors

TokenLightDarkUse Case
.labelBlackWhitePrimary text
.secondaryLabelGrayLight graySecondary text
.tertiaryLabelLight grayDarker grayTertiary text
.quaternaryLabelLighter grayDarkest grayDisabled text
.systemBackgroundWhiteBlackPrimary background
.secondarySystemBackgroundLight grayDark grayGrouped content
.tertiarySystemBackgroundWhiteDarker grayElevated content
.separatorLight grayDark grayDividers
.linkSystem blueSystem blueInteractive links

System Colors

ColorUse Case
.accentColorPrimary interactive elements
.redDestructive actions, errors
.orangeWarnings
.yellowCaution
.greenSuccess, positive
.blueDefault interactive
.purpleSpecial features
.pinkPlayful accents

Usage Pattern

// GOOD - Semantic colors
Text("Primary content")
    .foregroundColor(.label)

VStack {
    // content
}
.background(Color(.systemBackground))

// BAD - Hardcoded colors
Text("Primary content")
    .foregroundColor(.black)

VStack {
    // content
}
.background(Color.white)

Touch Targets

Requirements

  • Minimum: 44x44pt (Apple HIG requirement)
  • Bottom navigation: 46-50pt recommended
  • Spacing: 8pt minimum between targets

Implementation

// GOOD - System button provides proper touch target
Button(action: { /* action */ }) {
    Image(systemName: "xmark")
}

// GOOD - Custom with proper frame
Image(systemName: "xmark")
    .frame(width: 44, height: 44)
    .contentShape(Rectangle())
    .onTapGesture { /* action */ }

// BAD - Too small
Image(systemName: "xmark")
    .font(.system(size: 16))
    .onTapGesture { /* action */ }

Safe Areas

Respecting Safe Areas

// GOOD - Content respects safe areas
ScrollView {
    content
}
.safeAreaInset(edge: .bottom) {
    bottomBar
}

// Full-bleed backgrounds that extend into safe areas
ZStack {
    Color.blue.ignoresSafeArea()

    VStack {
        content // Content still respects safe areas
    }
}

Device-Specific Considerations

DeviceTop Safe AreaBottom Safe Area
iPhone (notch)47pt34pt
iPhone (Dynamic Island)59pt34pt
iPhone SE20pt0pt
iPad20pt0pt

Spacing Scale

Base unit: 4pt

SizeptUse Case
xs4ptInline spacing
sm8ptRelated elements
md12ptGroup spacing
lg16ptSection spacing
xl20ptMajor divisions
2xl24ptPage margins (compact)
3xl32ptLarge gaps

Standard Margins

ContextMargin
Compact width16pt
Regular width20pt
List insets16pt leading, 20pt trailing

DO / DON'T

Property Wrappers

DO: Use @StateObject for owned objects

struct ContentView: View {
    @StateObject private var viewModel = ContentViewModel()

    var body: some View {
        Text(viewModel.text)
    }
}

DON'T: Use @ObservedObject for owned objects

struct ContentView: View {
    @ObservedObject var viewModel = ContentViewModel() // Re-created on every view update!

    var body: some View {
        Text(viewModel.text)
    }
}

List Performance

DO: Use LazyVStack/List for long content

ScrollView {
    LazyVStack {
        ForEach(items, id: \.id) { item in
            ItemRow(item: item)
        }
    }
}

DON'T: Use VStack for many items

ScrollView {
    VStack { // All items created at once
        ForEach(items, id: \.id) { item in
            ItemRow(item: item)
        }
    }
}

View Identity

DO: Provide stable IDs in ForEach

ForEach(items, id: \.id) { item in
    ItemRow(item: item)
}

DON'T: Use indices or miss id parameter

ForEach(items.indices, id: \.self) { index in // Breaks on reorder
    ItemRow(item: items[index])
}

Type Erasure

DO: Use @ViewBuilder or concrete types

@ViewBuilder
var content: some View {
    if condition {
        Text("A")
    } else {
        Image(systemName: "star")
    }
}

DON'T: Use AnyView excessively

var content: AnyView { // Kills performance
    if condition {
        return AnyView(Text("A"))
    } else {
        return AnyView(Image(systemName: "star"))
    }
}

Modifier Order

DO: Background before padding, frame before overlay

Text("Hello")
    .padding()
    .background(Color.blue) // Includes padding in background

Text("World")
    .frame(maxWidth: .infinity)
    .overlay(alignment: .trailing) { // Overlay spans full width
        Button("Edit") { }
    }

DON'T: Wrong order causes unexpected results

Text("Hello")
    .background(Color.blue) // Only behind text
    .padding() // Padding outside background

Text("World")
    .overlay(alignment: .trailing) { // Overlay only covers text width
        Button("Edit") { }
    }
    .frame(maxWidth: .infinity)

Severity Levels

When auditing, classify issues as:

LevelIconDescriptionExample
Critical🔴Blocks accessibility or causes crashesMissing accessibilityLabel
Important🟠Violates HIG or hurts UXTouch target < 44pt
Warning🟡Suboptimal but functionalHardcoded color
Suggestion🔵Polish opportunitiesNon-standard spacing

Expert References

SwiftUI Architecture & Patterns

Modern iOS 18 Features

Anti-Patterns & Scanning

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

android-design

No summary provided by upstream source.

Repository SourceNeeds Review
General

ios-design

No summary provided by upstream source.

Repository SourceNeeds Review
Security

AI Cybersecurity & Privacy Audit — Find Every Digital Threat to Your Business Before Hackers Do

Scans your company domain for data breaches, vulnerabilities, employee risks, and vendor exposures, then generates a prioritized cybersecurity report with re...

Registry SourceRecently Updated
Security

test

Security hardening patterns for production AI agents. Covers prompt injection defense (7 rules), data boundary enforcement, read-only defaults for external i...

Registry SourceRecently Updated
70Profile unavailable