如何找出某个 OSX 版本可用的 API 版本?

How to find out which version of API is available for a certain OSX version?

我想检索照片库中照片资产的一些元数据。基本上是它的名称、类型和位置。我想在 Swift.

中将其实现为命令行实用程序

这是我想出的代码

var allPhotos : PHFetchResult<PHAsset>? = nil
let fetchOptions = PHFetchOptions()
allPhotos = PHAsset.fetchAssets(with: .image, options: fetchOptions)

但是因为'fetchAssets(with:options:)' is only available in macOS 10.15 or newer编译失败。

我的应用程序针对 运行 10.14,我的 MBP 仍然是 运行ning 10.14。

当我查看文档页面 (https://developer.apple.com/documentation/photokit/phasset) 时,

我在页面上找不到每个 API 旁边的 os 版本信息。

找到此类信息的最简单方法是什么?

另外,我怎样才能使代码适用于 10.14?

macOS 版本要求

What is the easiest way to find such information?

the page 上说需要 10.15+:


备选方案

Also how can I make the code work for 10.14?

使用 fetchAssets(in:options:) (min 10.13) instead of fetchAssets(with:options:)(最低 10.15)。