【发布时间】:2017-02-10 21:09:08
【问题描述】:
所以以前,在 Swift 2.2 中我可以使用 Entity.image = UIImagePNGRepresentation(UIImage(named: "Image Name")!)
但现在在 Swift 3.0 中,我们现在似乎必须使用一个额外的步骤。 Entity.image = NSData(data: UIImagePNGRepresentation(UIImage(named: "Image Name")!)) 或 UIImage(name: "Image Name") 的等效对象
在 Swift 3.0 中是否有一种从 UIImage 到 NSData 的新方法?
【问题讨论】:
标签: ios swift3 uiimage ios10 nsdata