All you have to do is set kCALineCapRound for the lineCap property of your CAShapeLayer, and then set lineDashPattern to [0.0, x], where, for example, x is 2 * the line width of your CAShapelayer, if you want the border between the points to be same as the diameter of your dots.
0.0 for the first colored segment in lineDashPattern calls kCALineCapRound draws a semicircle in front of and behind your colored segment, and any colored segment greater than zero causes a dot to become a tablet. 
source share