将代码从 Swift 2 更改为 swift 4
Change code from Swift 2 to swift 4
我是 Swift 的新人,我需要你的帮助。
我正在编写教程 swift 2 中的代码,我想在 swift 4 中编写代码。
let imgManager = PHImageManager.default()
let requestOptions = PHImageManager()
requestOptions.synchronous = true //error:Value of type 'PHImageManager' has no member 'synchronous'
requestOptions.deliveryMode = .highQualityFormat // error:Value of type 'PHImageManager' has no member 'deliveryMode'
应该是这样的,
let imgManager = PHImageManager.default()
let requestOptions = PHImageRequestOptions()
requestOptions.isSynchronous = true
requestOptions.deliveryMode = .highQualityFormat
requestoptions 是 PHImageRequestOptions()
不是 PHImageManager()
我是 Swift 的新人,我需要你的帮助。
我正在编写教程 swift 2 中的代码,我想在 swift 4 中编写代码。
let imgManager = PHImageManager.default()
let requestOptions = PHImageManager()
requestOptions.synchronous = true //error:Value of type 'PHImageManager' has no member 'synchronous'
requestOptions.deliveryMode = .highQualityFormat // error:Value of type 'PHImageManager' has no member 'deliveryMode'
应该是这样的,
let imgManager = PHImageManager.default()
let requestOptions = PHImageRequestOptions()
requestOptions.isSynchronous = true
requestOptions.deliveryMode = .highQualityFormat
requestoptions 是 PHImageRequestOptions()
不是 PHImageManager()