All skills
johnrogers avatar

/ios-26-platform

@d62eb71

Use when implementing iOS 26 features (Liquid Glass, new SwiftUI APIs, WebView, Chart3D), deploying iOS 26+ apps, or supporting backward compatibility with iOS 17/18.

Use this Skill: https://skilld.dev/gh/johnrogers/claude-swift-engineering/ios-26-platform

This session only. Nothing lands on disk.

referencesswiftui-apis.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

SwiftUI 26 New APIs

iOS 26+, iPadOS 26+, macOS Tahoe+

WebView & WebPage

Basic WebView

import WebKit

struct ArticleView: View {
    let articleURL: URL

    var body: some View {
        WebView(url: articleURL)
    }
}

WebPage (Observable Model)

import WebKit

struct BrowserView: View {
    @State private var webPage = WebPage()

    var body: some View {
        VStack {
            Text(webPage.title ?? "Loading...")

            WebView(page: webPage)

            HStack {
                Button("Back") { webPage.goBack() }
                    .disabled(!webPage.canGoBack)

                Button("Forward") { webPage.goForward() }
                    .disabled(!webPage.canGoForward)
            }
        }
    }
}

@Animatable Macro

Before (Manual animatableData)

struct HikingRouteShape: Shape {
    var startPoint: CGPoint
    var endPoint: CGPoint
    var elevation: Double

    // Tedious manual declaration
    var animatableData: AnimatablePair<CGPoint.AnimatableData,
                        AnimatablePair<Double, CGPoint.AnimatableData>> {
        get {
            AnimatablePair(startPoint.animatableData,
                          AnimatablePair(elevation, endPoint.animatableData))
        }
        set {
            startPoint.animatableData = newValue.first
            elevation = newValue.second.first
            endPoint.animatableData = newValue.second.second
        }
    }
}

After (@Animatable Macro)

@Animatable
struct HikingRouteShape: Shape {
    var startPoint: CGPoint
    var endPoint: CGPoint
    var elevation: Double

    @AnimatableIgnored
    var fillColor: Color // Excluded from animation

    // animatableData automatically synthesized!
}

Requirements:

  • Properties must be VectorArithmetic (Double, CGFloat, CGPoint)
  • Use @AnimatableIgnored for non-animatable properties

Chart3D

import Charts

struct ElevationChart: View {
    let hikingData: [HikeDataPoint]

    var body: some View {
        Chart3D {
            ForEach(hikingData) { point in
                LineMark3D(
                    x: .value("Distance", point.distance),
                    y: .value("Elevation", point.elevation),
                    z: .value("Time", point.timestamp)
                )
            }
        }
        .chartXScale(domain: 0...10)
        .chartYScale(domain: 0...3000)
        .chartZScale(domain: startTime...endTime)
    }
}

TextEditor with AttributedString

struct CommentView: View {
    @State private var comment = AttributedString("Enter your comment")

    var body: some View {
        TextEditor(text: $comment)
        // Built-in formatting controls (bold, italic, etc.)
    }
}

Features:

  • Binding to AttributedString preserves formatting
  • Automatic toolbar with formatting options
  • Customizable paragraph styles and attribute constraints

New View Modifiers

sliderThumbVisibility

Slider(value: $progress)
    .sliderThumbVisibility(.hidden)
// For media players, progress indicators

safeAreaBar

List { ... }
    .safeAreaBar(edge: .bottom) {
        Text("Bottom Action Bar")
            .padding(.vertical, 15)
    }
    .scrollEdgeEffectStyle(.soft, for: .bottom)
// Sticky bars with progressive blur

In-App URL Opening

@Environment(\.openURL) var openURL

Button("Open In-App") {
    openURL(website, prefersInApp: true) // SFSafariViewController style
}
// Default Link opens in Safari app

Button Roles

Button(role: .close) {
    showSheet = false
}
// Renders as X icon with glass effect in toolbars

Button(role: .confirm) {
    confirmAction()
}
// System-styled confirmation button

GlassButtonStyle (iOS 26.1+)

Button("Clear Glass") { }
    .buttonStyle(GlassButtonStyle(.clear))

Button("Regular Glass") { }
    .buttonStyle(GlassButtonStyle(.glass))

Button("Tinted Glass") { }
    .buttonStyle(GlassButtonStyle(.tint))
    .tint(.blue)

buttonSizing

Button("Fit") { }
    .buttonSizing(.fit)      // Shrinks to label

Button("Stretch") { }
    .buttonSizing(.stretch)  // Fills available width

Button("Flexible") { }
    .buttonSizing(.flexible) // Balanced

Drag and Drop Enhancements

struct PhotoGrid: View {
    @State private var selection: Set<Photo.ID> = []
    let photos: [Photo]

    var body: some View {
        LazyVGrid(columns: columns) {
            ForEach(photos) { photo in
                PhotoCell(photo: photo)
                    .draggable(photo)
            }
        }
        .dragContainer {
            // Return selected items
            selection.compactMap { id in
                photos.first { $0.id == id }
            }
        }
        .dragConfiguration(.init(supportedOperations: [.copy, .delete]))
        .dragPreviewFormation(.stack)
        .onDragSessionUpdated { session in
            if case .ended(.delete) = session.phase {
                deleteSelectedPhotos()
            }
        }
    }
}

visionOS Spatial Layout

Alignment3D

HikingRouteView()
    .overlay(alignment: sunAlignment) {
        SunView()
    }

var sunAlignment: Alignment3D {
    Alignment3D(horizontal: .center, vertical: .top, depth: .back)
}

Manipulable Objects

Model3D(named: "WaterBottle")
    .manipulable() // Users can pick up and move

Scene Snapping

@Environment(\.sceneSnapping) var sceneSnapping

var body: some View {
    Model3D(named: item.modelName)
        .overlay(alignment: .bottom) {
            if sceneSnapping.isSnapped {
                Pedestal()
            }
        }
}

GlassEffectContainer

// Optimize multiple glass effects
GlassEffectContainer {
    HStack {
        Button("Action 1") { }.glassEffect()
        Button("Action 2") { }.glassEffect()
        Button("Action 3") { }.glassEffect()
    }
}
// Benefits: Performance optimization, fluid morphing between shapes

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The analyzed skill consists purely of markdown documentation and reference guides for implementing speculative iOS 26 platform features. No code execution, external downloads, prompt injections, or other security threats were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at d62eb71. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 9 months ago

README badge

README badge for johnrogers/claude-swift-engineering/ios-26-platform