Maxim Yeliseyev
Maxim Yeliseyev

Reputation: 23

Image Literal - Editor placeholder in source file, cannot make it work

When adding an icon to the assets folder it says "Editor placeholder in source file". Does anyone know the solution?

let logo: UIImageView = {
    let l = UIImageView()
        l.image = #imageLiteral(resourceName: "128x128")
        l.contentMode = .scaleToFill
        l.layer.masksToBounds = true
        //l.layer.cornerRadius = 20
    return l
}()

Upvotes: 1

Views: 123

Answers (1)

Len_X
Len_X

Reputation: 863

Just type image literal and it will complete with default icon. enter image description here

Double click on this icon and it will open the media library right side of it. enter image description here

then pick the image you want enter image description here

Upvotes: 1

Related Questions