I want to draw a line with dynamic width as shown in attached picture. What should be the best approach for this. ?

Updated:
My task is to draw line on finger move. And the line width is changes as speed of swipe is change. both (Line width and finger swipe speed) are directly proportional .