This post is from 2011, about 14 years ago. Some of it may be out of date.

▸ Attaching a UIView to the UIScrollViewIndicator

1 min readiOS Development, Open Source

Jake Marsh

Here’s a neat little write up (sample code included) from Florian Mielke of how to replicate Path 2.0‘s neat behavior of “attaching” a timestamp indicator that follows iOS’s built-in scroll indicator as you scroll.

The basic idea is to add the info panel’s root layer as a sublayer to the indicator’s root layer. With that, the info panel scrolls smoothly and stays in parallel to the indicator automatically. In the case were the scroll view hit the edges, we want the info panel to stay visible at the top or bottom of the screen, so we need to do some extra calculation to let it stay centered.

iPhone simulator with a round info panel attached to the scroll view's scroll indicator on the right edge

Love the technique, can’t wait to see something like this start showing up in more apps. I think anything that intuitively allows developers and designers a way to remove ugly information like timestamps from rows of data is awesome.

Update: Here’s a web-based implementation of the same effect.

Link: blog.madefm.com/post/13817640556/ios-devcorner-attaching-an-info-panel-to-a