如何使用从iPad游乐场照片库导入的图像?

时间:2019-02-08 20:05:10

标签: ios swift swift-playground

我是Swift的新手,最近在iPad Playground APP中学习了Swift。 我发现可以从iPad的照片库导入图像。该图像显示为图像图标。我不知道如何报价。

let myNode = SCNNode()
let mySphere = SCNSphere(radius: 0.1)
myNode.position = SCNVector3(0, -0.5, -1.2)
myNode.geometry = mySphere
let myMaterial = SCNMaterial()
myMaterial.diffuse.contents = #imageLiteral(resourceName:"earth.jpg")

“#imageLiteral(resourceName:“ earth.jpg”)”在iPad Playground APP中显示为图像图标。

0 个答案:

没有答案