This article in the playground describes how to do that and shows the code that is needed. I even think it uses the same graphic as you posted here.
This article in the playground describes how to do that and shows the code that is needed. I even think it uses the same graphic as you posted here.