For an application I'm working on, I'd like to implement sort of a gauge-like control. The gauge should be of vertical orientation and I'd like to get the effect of a dial with the values printed on it to move vertically so that the current value appears at the center of the gauge. While the part of the dial that is not currently visible gets clipped.
I thought a good approach would be to have one UIView that acts as the top visible part (the gauge's window if you will) and a subview that just draws the dial with the values and markers. The top view would receive a message indicating the value to display and move the subview around so that the current value is centered while the part of the dial that is not currently visible gets clipped. I tried to do a little illustration of this (the part of the dial that is grayed-out should be clipped):
I'm am unsure how to set up the views so that I can actually get this to work. I tried around with two UIView subclasses but the view rendering the dial would just paint at some unexpected location on the screen and wouldn't be clipped by the parent view.
I'm really just looking for general advice on the parts needed to implement a control like this. Does it make sense to use two views as I tried to describe or should I implement this as one single UIView subclass that just figures out which part of the dial to draw whenever the value is changed? Or maybe something completely different?