座標と名前を持つ「場所」オブジェクトの配列があります。
例えば:
let places = [place(name: "Eiffel Tower", latitude: 48.8582, longitude: 2.2945), place(name: "Statue of Liberty", latitude: 40.6892, longitude: -74.0444), place(name: "Tower of London", latitude: 51.5081, longitude: -0.0761)]
この配列から、マップを使用して MKPointAnnotations の新しい配列を作成したいと思います。私はそれが次のように始まることを知っています:
let placeAnnotations = places.map{ (place -> MKPointAnnotation // but that's about all I know for sure!}
... 構文エラーを起こさずに MKPointAnnotation の .coordinate および .title プロパティを設定する方法がわかりません。ありがとうございました!