Every year I try to build custom native UI with every-frame-perfect animations with SwiftUI, and every year after fighting against nature for a few days, I once again write custom NSViews with CoreAnimation layers. SwiftUI just isn't ready for that yet.
Positive users praise the beauty and simplicity of Mitchell Hashimoto's split layout framework for smooth Apple platform animations, while negative users criticize SwiftUI as unreliable for custom native UI.
No Digg Deeper questions have been answered for this story yet.
Most Activity
Work-in-progress: a new split layout framework for nearly all Apple platforms (macOS, iOS, etc.). A mix of SwiftUI and raw CoreAnimation. The goal is "every frame perfect" animation. Still very wip, but getting there! Goal is to bring it back to Ghostty eventually.
Its easy to take this stuff for granted (and you should, really). But there are some fun problems and details here to think about, despite still being very under development. If you like the details, read on.
First, getting that "new split" animation right was tricky. The new split places at full size (so there is no resize jitter). Then, we pick a place to slide it out from: off window, beneath another split.
Splits may be semi-transparent so there is an occlusion mask that we blank out pixels for, so even if its coming out from under a semi-transparent split, you don't see it blending through.
We have to be careful how we animate in the divider. I'm not totally sold on the approach here, but right now it expands out as the split comes in. It felt better to have pixels from the new split start showing up immediately. But, still experimenting.
For layout, all my prior split UIs on macOS and Linux used a nested view approach: recursive views of splits and leaves. This time, I did something different which was hugely beneficial: the tree structure is a tree, but I rasterize it to a 2D grid with absolute offsets. So the view is actually flat! Its just one layout view with N panes.
The benefit of the flat view is that animation is very easy cause its all happening across one layer/grid.
The "drop zone" animation is an overlay above the entire 2D grid. Its not intrinsic to the pane, it floats above it. This makes it easy to animate across the dividers as you can see in the video. Lesson learned from Ghostty, which does not do that and made animation impossible.
The corner radius of the drop zone and panes by default tries to match the [dynamic] corner radius of macOS 26. So you always get a radius-perfect corner. Very annoying, but a good detail to get right.
Going to keep hammering away at this...
Work-in-progress: a new split layout framework for nearly all Apple platforms (macOS, iOS, etc.). A mix of SwiftUI and raw CoreAnimation. The goal is "every frame perfect" animation. Still very wip, but getting there! Goal is to bring it back to Ghostty eventually.

@rezacentral This is just a library, but it will be used for the native app for my multiplexer yes.

My point is this: creating a new window using a split layout sacrifices the wrong thing. I always find that a half-split weakens the content in the old window in some way: creating a bottom window makes the existing one jump, sometimes pushing content out of the viewport. Creating a right window causes the text in the left window to wrap awkwardly.
When the user creates a new window, the existing window’s size shouldn’t change at all. Don’t make the user wonder whether the view of the existing window will be compressed. It simply shouldn’t.
IMO, this is where Niri makes a much better design choice: none of the existing windows are squeezed/resized, so my content stays exactly the same.

@joshmanders That's a library user concern. The actual split layout is a caller-provided immutable data structure they can choose to make Codable (the Apple encoding protocol) if they want.

@mitchellh Watch out, @LouisDhauwe! True PanelKit replacement!

@mitchellh that's not about swiftnutty being slow, it's about how apple hasn't solved the complex layout and animation problems core animation was mean

@morew4rd Haha fear not

@mitchellh is this your tmux experiment?

@ljsv89 Well first this is macOS

@royalicing Already have 1px dividers. It’s all configurable!

@mitchellh Tree data structure?

@this_is_moody Tree data structure but rasterized down to a 2D absolute layout so the view hierarchy is actually flat.

The SwiftUI pattern is universal — every high-level abstraction holds until you need frame-perfect control, then you're back to the layer below. Go has the same thing: channels and goroutines until you need sync/atomic. The abstraction is never the final answer, just the starting point.

@mitchellh I know you’ve shared some beef with Swift in the past. Any updates to this in the age of AI coding?

@TH0JENSEN when its ready, dunno

@el_tuki_ thats a macOS setting. if you set reduce motion on macOS it doesn't animate at all, we respect it.

@mitchellh 🥀for tmux (am so pump to have a better solution)

@mitchellh Is this going to come down to libghostty?

@mitchellh Stopped using Ghostty. It broke too many times when trying to resize split windows.