如何在 Swift 中使用 Apple 地图 - 你必须使用 C 还是 Swift 可以?

How to use Apple maps in Swift - Do you have to use C or is Swift okay?

我想在 Swift 中使用 apple maps 以便能够输入,比方说,3 个地址。然后程序会找出最快的路线。我的问题是我什至找不到在 swift 中使用地图显示的苹果文件。

我看了这里

The Swift Programming Language - Basics (不仅仅是介绍,大部分)。

在介绍中说

Location services are provided by the Core Location framework, which defines Objective-C interfaces..."

我根本找不到使用地图的示例代码,所以我想我要问的是:

  1. 这在 swift 中有效吗?
  2. 您是否知道任何可能有帮助的文件或包含如何完成此操作的示例代码的网站?

这里有什么问题?例如。 CLLocation -startUpdatingLocationdocumentation 还包含对其 Swift 绑定的描述:

func startUpdatingLocation()

您可能会看到这样一种情况,Apple 在 Swift 可用后就没有更新编程指南,您通常可以推断 "Objective-C and Swift" 其中提到 "Objective-C"。