Building iOS and Mac apps in Zed: SwiftUI Previews
2025-11-26
This is a followup to Build, run and debug iOS and Mac apps in Zed instead of Xcode.
So now we know you can do much of the coding for your apps in Zed, but it seems that you still need to switch back to Xcode to write UI code – if you want previews that is.
Or do you?
(A brief video with no sound)
Wait, that's just an Xcode window behind a Zed window!
Yes indeed. Xcode helpfully updates the preview whenever you save a file. Changes are a bit slower to appear, but it's actually quite usable and it's nice staying in Zed when the situation allows.
By the way, notice that we get proper working code completion, including for the images and colours in your asset files. If you're new to this series of articles, now might be the time to go and read the first one.
Bonus points: preview a different file without leaving Zed
If you were watching carefully, you'll have noticed that I switched to working on an entirely different app screen part way through the video.
I did that with a small shell script that I've named xcode-open-file:
#!/bin/sh
and a Zed task:
which of course I created a key binding for.
@lxmn@mastodon.social