Found the reason. Instead of using
let polyline = MKPolygon()
I had to use
let polyline = MKPolyline()
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: