title: Drawing dots and lines on to a UIView
body: <p>I gave myself an exercise to learn Swift, based on an example I have found on the Apple Swift <a href="http://www.apple.com/swift/" rel="noreferrer">website</a>:</p>
  
  <p><a href="https://i.stack.imgur.com/DowhG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DowhG.png" alt="enter image description here"></a></p>
  
  <p>As you can see there's a river and a few dots in it right in the middle, forming a path. So I have started looking for a similar river image on the internet and I have created a Xcode playground. This is what I have now:</p>
  
  <p><a href="https://i.stack.imgur.com/rHZUN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rHZUN.png" alt="enter image description here"></a></p>
  
  <p>So basically I have an <code>UIView</code> with a subview consisting in the river image I have found and a dot made with <code>UIBezierPath</code>.</p>
  
  <p>My <strong>first</strong> question is: is this the right way to drawn on to a UIView? I mean using a <code>UIBezierPath</code>. And my <strong>second</strong> question is: how do I draw the dot at a precise coordinate inside the <code>UIView</code>? (<code>UIBezierPath</code> or everything else?)</p>
  
  <p>Just to be more precise, my intent here is to make an algorithm to make the program recognize the image and based on the pixel color it would draw a line with dots from the start to the end of the river, passing between it's middle. </p>