Fun with Split-Views
I don’t really know where to start on this blogging project. I like some of the features of Jekyll and want them in a Mac app – that’s about as far as my app specification goes – and is probably why I’ve been looking at a blank Xcode project for too long.
To break the writer’s block, I’ve just been throwing together some chopped up app parts I had lying around. Here’s what’s in the screenshot of this app-salad: a default toolbar, an outline-view set to source-list mode, a few text fields and a code editor that I dragged over from Stacks.
I usually leave split views with mostly default behavior and basic constraints. My feeling is that whenever they’re too clever they break. But I noticed another app that had a nice, and relatively simple way to prioritize column resizing as the window gets narrower.
The idea is that the left and right sidebars remember their width as fixed values. As you resize the window only the content area changes. Only after the content area reaches its narrowest limit will the sidebars begin to shrink too. First the right will get narrower. And when it reaches its limit, then finally the left sidebar shrinks. This part is fine, and is relatively easy to set up with some basic constraints.
But here’s the surprising bit: the process is completely reversible. As the window gets larger, the sidebars will return to their previous positions, even after a relaunch. Each sidebar has a desired natural width that it will return to before the content area is allowed to grow. The natural width only changes when the user manually drags the split to a new size. Resizing the window, relaunching the app, or moving it to a new window might affect the sidebars temporarily, but nothing affects the natural width except direct manipulation of the split.
To be honest, I’m not even sure I’m going to use this in the app long term, or if this sort of split-view arrangement makes sense here. I just kind of wanted to fiddle with the split-views to see if I could build something similar and it was a good way to move past that daunting blank Xcode window.
What is this: these are random snippets from my dev journal. I’ve been working on a simple blogging app for fun. This is a non-serious side project, progresses very slowly, and will probably never see the light of day. The images may not perfectly correspond to the journal entry. In most cases I’ve added them later based on the relative time of git checkins.