Xcode 10 - image literals no longer available

后端 未结 9 2066
甜味超标
甜味超标 2020-12-08 03:46

Xcode 10 Release Notes: \"Code Completion for Swift image literals has been removed in Xcode 10\"

So it\'s not a bug that I couldn\'t ad

9条回答
  •  [愿得一人]
    2020-12-08 04:13

    TIP: To fix three resolutions after add a literal image in code.
    1. Remove another, keep only one image
    2. Comment your line code with literal image, then will appear literal image in code, like: #imageLiteral(resourceName: "image@2x.png"
    3. in resourceName value, remove @2x and file extension, like .png, keep only image name: #imageLiteral(resourceName: "image")
    4. Uncomment! Image will be showed in code.

提交回复
热议问题