Delaunay Triangulation implementation written in swift https://en.wikipedia.org/wiki/Delaunay_triangulation
Generate a set of vertices and pass them into Delaunay.triangulate(vertices)
which will then return the optimal set of triangles.
See the example project for more details.