Swift + Metal · iOS 17+

Fold anything.

Foldy folds any screen like a pane of frosted glass. The interface stays where it was; only the glass moves. Fold one screen into another, tilt a view with the gyroscope, or let the Dynamic Island swallow a card. SwiftUI and UIKit, no dependencies.

MITSwiftUI · UIKitONE METAL SHADERSWIFT 6

Recorded on an iPhone.

Every clip is a real screen from the demo app, captured on device. Nothing is composited after the fact; the frost, the crease, and the island are all the shader.

Where the fold comes from.

On September 9, 2026 Apple unveiled iPhone Duo, its first foldable iPhone, shipping October 23. The interface adapts as the device folds, and a new display engine drives both screens during the transition.

“iOS seamlessly adapts to the new ways to use iPhone Duo — content reacts as it folds, reorients when turned to the side, and switches to the appropriate display when flipped over.” Apple Newsroom, “Apple unveils iPhone Duo”

Foldy is an independent recreation of that visual idea for any iPhone: the interface lives on a fixed plane, the viewer's eye stays put, and the screen becomes a pane of frosted glass rotating around a hinge. Every pixel casts a ray from the eye through the glass to the interface, then blurs and darkens by the gap. It is not Apple's implementation and not a display-handoff API.

The projection and optics are adapted from Elijah Semyonov's DuoLikeAnimation, MIT. Foldy adds texture capture, two-view compositing, a blur pyramid, page turns, materials, the island, and gesture and motion inputs.

What's in the box.

One shader, a small state machine, and thin adapters for both UI frameworks.

FoldTransition

Fold between two SwiftUI views. Zero is the source, one the destination. Animate it or drive it from a gesture; both views keep their state.

.foldEffect(tilt:)

Tilt one view on one or two axes, like the original demo. Pair it with FoldMotionSource to follow the phone.

.foldSwipe(progress:)

Any swipe folds toward the other endpoint and settles on release. A UIKit pan on the fold container, so content stays tappable.

FoldPager

Page or grid-navigate a list with page turns. Swipes and phone nudges built in.

FoldCutout

The Dynamic Island's measured frame, a pull that folds a view into it, magnetic scroll settling, and the liquid merge.

FoldAppearance

Frosted, clear, grain, gloss, ink, midnight. Each is a material with its own optics and a finish in the shader.

FrostedHeavy blur that darkens with distance. The reference.
ClearPure projection. No blur, no darkening.
GrainSanded glass with visible speckle.
GlossA highlight sweeps across the pane as it tilts.
InkSharp fold, shadow bleeding from the crease.
MidnightCool, dark, heavily diffused.

Quick start.

Add the package, wrap two views, bind a number. The Metal shader ships in the package; nothing to copy into your app.

Package.swift

dependencies: [
    .package(url: "https://github.com/insanearts/foldy.git", from: "0.1.0")
]

SwiftUI

import Foldy

struct Example: View {
    @State private var progress = 0.0

    var body: some View {
        FoldTransition(progress: progress) {
            FirstScreen()
        } destination: {
            SecondScreen()
        }
        .foldSwipe(progress: $progress)
    }
}

// Tilt one view like frosted glass
Card().foldEffect(angle: .degrees(30))

UIKit

let fold = FoldContainerView(source: first, destination: second)
view.addSubview(fold)
fold.frame = view.bounds
fold.animate(to: .destination)
// or drive a gesture
fold.setProgress(0.4)

Device motion

@State private var motion = FoldMotionSource()

content.foldEffect(tilt: motion.tilt)
    .onAppear { motion.start() }
    .onDisappear { motion.stop() }

// 120 Hz gyro, 40 ms prediction, calibrated neutral