LoginSignup
1
0

Xcode15でImageLiteralが使えない

Posted at

Swiftを使った開発経験は全くないが、メモとしてここに残しておく。

環境

Xcode 15.3

やりたかったこと

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var diceeImageView1: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        goriraImage.image = imageLiteral
    }


}

goriraImage.image = imageLiteral こんな感じでimageLiteralというものをつかって画像を参照したかったがXcodeのversionによっては使用することができないらしい。

どうするか

goriraImage.image = #imageLitera(

とすることで使用することができた。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0