title: Append coordinate to MapBox MGLPolyline
body: <p>I am trying to append a coordinate to a line that I am annotating a MapBox map with.</p>
  
  <p><code>MGLPpoyline</code> has the following function for appending coordinates:</p>
  
  <pre><code>appendCoordinates(_ coords: UnsafePointer&lt;CLLocationCoordinate2D&gt;, count: UInt)
  </code></pre>
  
  <p>I cannot for the life of me figure out how to pass a single coordinate point to the above function. The UnsafePointer bit has me going bananas. I've been looking all over the net but any solution I tried ends up with the following runtime error:</p>
  
  <blockquote>
    <p>Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>
  
  <p>I have just a regular <code>CLLocationCoordinates2D</code> instance at hand, which is verified to contain valid coordinates at the time of the function call.</p>
  
  <p>Here's one of the things I've tried:</p>
  
  <pre><code>let coord = currentLocation!.coordinate // Verified valid
  var coords: [CLLocationCoordinate2D] = [coord]
  aLine.appendCoordinates(&amp;coords, count:UInt(coords.count))  // Unexpectedly found nil...
  </code></pre>
  
  <p>btw, the following runs perfectly fine:</p>
  
  <pre><code>var line = MGLPolyline(coordinates:&amp;coords, count:UInt(coords.count))
  </code></pre>
  
  <p>My apologies if I'm missing the obvious but I'm kinda new to Swift.</p>
  
  <p>Any help or examples of the above function in use would be greatly appreciated.</p>