-
StackOverflow 文件
-
Dropbox API 教程
-
獲取檔案後設資料
-
使用 SwiftyDropbox 庫獲取包含媒體資訊的檔案的檔案後設資料
Dropbox.authorizedClient!.files.getMetadata(path: "/test.jpg", includeMediaInfo: true).response { response, error in
if let result = response as? Files.FileMetadata {
print(result.name)
if result.mediaInfo != nil {
switch result.mediaInfo! as Files.MediaInfo {
case .Pending:
print("Media info is pending...")
case .Metadata(let mediaMetadata):
print(mediaMetadata.dimensions)
print(mediaMetadata.location)
print(mediaMetadata.timeTaken)
}
}
} else {
print(error!)
}
}