我错误地将我的项目更新到Swift 4.2,而没有等待pod更新.我已经慢慢更新了我的所有代码,但有一行我似乎无法弄清楚.
var animationRect = UIEdgeInsetsInsetRect(frame, UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding))
Run Code Online (Sandbox Code Playgroud)
我收到的错误是,
UIEdgeInsetsInsetRect'已被实例方法'CGRect.inset(by :)取代
任何有关这方面的帮助将不胜感激!
我在 CloudKit 中保存了图像作为资产。每个记录还有其他属性。我可以收集记录并使用其他属性,但我无法在我的 ImageView 中使用资产。我是 Swift 编程的新手,因此我收到的错误没有任何意义。
let container = CKContainer.default()
let publicDB = container.publicCloudDatabase
let query1 = CKQuery(recordType: "movieArray", predicate: predicate2)
publicDB.perform(query1, inZoneWith: nil) {(results:[CKRecord]?, error:Error?) in
if error != nil {
DispatchQueue.main.async {
print("Cloud Query Error - Fetch Establishments: \(String(describing: error))")
}
return
}
for record in results! {
DispatchQueue.main.async {
let asset = record["myImageKey"] as? CKAsset
let data = NSData(contentsOf: (asset?.fileURL)!)
let image = UIImage(data: data! as Data)
print("Test")
self.detailImage.image = image
}
self.movieCast.text = record.object(forKey: "Actors") …Run Code Online (Sandbox Code Playgroud)