I am a beginner and I have a picture displayed in the center of the screen (this is a prototype to check if everything works), but the picture is not displayed, I copied the name completely, but it does not work. does not work with UIImage(systemName: ""). but if i use picture from Assets.xcassets but everything shows.
my code:
override func viewDidLoad() {
super.viewDidLoad()
let imageView = setupImageView(in: view)
imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
imageView.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
}
func setupImageView(in view: UIView) -> UIImageView {
let imageView = UIImageView()
imageView.image = UIImage(systemName: "pencil.and.outline")
imageView.contentMode = .scaleAspectFill
imageView.clipsToBounds = true
imageView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(imageView)
return imageView
}
an empty screen with a call is a call from sfsymbol, a screen with a dog is a screen with assests
I asked programmers with experience in chat, but no one faced such a problem