-1

I am facing a problem that is quite strange. I just want to set an ImageLiteral to the UIImageView and it crashes the app without popping up any error or exception. It tried it in simulator and everything is ok. But when I install my app on iPad (6th) iOS 13.6, it crashed.

The project is working fine on 2019/8/15. I just pull it and rebuild on real device, didn't change a thing for this part. The deployment target version is iOS 10. Maybe it's because I didn't config the dark mode things? Any idea?

@IBOutlet weak var anatomyImgView: UIImageView!
anatomyImgView.image = #imageLiteral(resourceName: "bodyoutline_black")

Update:

Here's the image configuration

enter image description here

enter image description here

RedSIght
  • 538
  • 5
  • 13

1 Answers1

-1

It can be one of two things:

  1. The syntax should be #imageLiteral(resourceName: "bodyoutline_black").
  2. The spelling is different.

Quickest way to check is if the image icon appears inside the code and doesn't appear as a placeholder.

Rikh
  • 4,078
  • 3
  • 15
  • 35