I have UIStackView (red). When I put in this stackView imageView with picture, this imageView becomes UIView and after that I can't change image even if I want.
I have slider, with image changes counter in my stack view, and button which should change images of my imageView.
Stack View contains only UIView, not UIIMAgeView. Because of that I can't change imageView image.
You need to cast the stackView.arrangedSubviews
elements to UIImageView
@objc func buttonAction(_ sender: UIButton) {
for case let imageView as UIImageView in stackView.arrangedSubviews {
imageView.image = newImage
}
}