SwiftUI now makes it straightforward to compose rich, animated visual pipelines by combining Metal shaders (colorEffect, distortionEffect, layerEffect) with TimelineView for per-frame time-driven animation and alignment guides for precise floating-view attachment. These building blocks chain together like pipes to produce production-quality effects without needing a separate rendering engine.
⢠layerEffect lets you run domain-warping Metal shaders directly on any SwiftUI view, enabling organic animated backgrounds that were previously only achievable in a custom Metal CALayer
⢠TimelineView with .animation schedule drives shader parameters every frame so you get smooth, stateless GPU animation tied to real clock time ā no Timer hacks required
⢠Alignment guides provide a semantic, size-agnostic way to attach floating overlay views (timestamps, badges) to container edges without manual offset calculations
Applies a time-driven layerEffect Metal shader to a SwiftUI Image, producing a flowing organic warp animation. The TimelineView fires every animation frame and passes elapsed time into the shader so the warp moves continuously.
import SwiftUI
import Metal
// backgroundWarp.metal (add this file to your Xcode target)
// --------------------------------------------------------
// #include <metal_stdlib>
// using namespace metal;
// #include <SwiftUI/SwiftUI_Metal.h>
//
// [[ stitchable ]] half4
// backgroundWarp(float2 position,
// SwiftUI::Layer layer,
// float2 size,
// float time) {
// float2 uv = position / size;
// // First noise sample using a simple sine-based stand-in for noise
// float2 offset1 = float2(sin(uv.y * 8.0 + time) * 0.03,
// cos(uv.x * 8.0 + time) * 0.03);
// // Domain warp: sample offset again at displaced position
// float2 uv2 = uv + offset1;
// float2 offset2 = float2(sin(uv2.y * 8.0 + time * 1.3) * 0.03,
// cos(uv2.x * 8.0 + time * 1.3) * 0.03);
// float2 warpedPos = position + (offset1 + offset2) * size;
// return layer.sample(warpedPos);
// }
// --------------------------------------------------------
struct AnimatedWarpView: View {
// Start time used to compute elapsed seconds
let startDate = Date()
var body: some View {
TimelineView(.animation) { context in
let elapsed = Float(context.date.timeIntervalSince(startDate))
GeometryReader { geo in
Image("coverArt") // replace with any asset in your catalog
.resizable()
.scaledToFill()
.blur(radius: 12)
.layerEffect(
ShaderLibrary.backgroundWarp(
.float2(Float(geo.size.width),
Float(geo.size.height)),
.float(elapsed)
),
maxSampleOffset: CGSize(width: 40, height: 40)
)
.clipped()
}
.ignoresSafeArea()
}
}
}
#Preview {
AnimatedWarpView()
}Liquid Glass is Apple's new material and visual design language introduced in iOS 27, bringing translucent, refractive glass-like surfaces to system and custom UI elements. It replaces the frosted vibrancy aesthetic with a more dynamic, depth-aware material that responds to content beneath it.
PaperKit is Apple's full-featured canvas framework ā previously internal-only ā now publicly available in iOS/macOS/visionOS 27. It powers the drawing and markup experience in Notes, Preview, and Freeform, giving developers access to a complete pencil, shapes, images, and text canvas with a rich data model.
Xcode 27 introduces a fully customizable toolbar and theme system, untitled scratch projects, coding agent integration directly in the editor, and the new Device Hub for evaluating apps across simulators and physical devices side-by-side.
In-depth guide
SwiftUI & Liquid Glass in iOS 27 āShader source files must be in a .metal file compiled into the app target ā they cannot be defined inline in Swift. layerEffect requires isEnabled:true and the shader must match the exact Metal function signature. Passing incorrect argument types between Swift and Metal will silently produce blank output at runtime with no compile-time error.
Metal shader execution requires a device with a GPU; runs on all modern iPhones and iPads. Performance of complex domain-warp shaders may vary on older A-series chips.
iOS 27 introduces new SwiftUI drag and drop APIs including reorderable, reorderContainer, dragContainer, and configuration modifiers that enable reordering within and across collections, multi-item drag, and fine-grained control over how data is transferred during drag and drop operations.