Is there a difference between removeFromSuperview
and .hidden
property for an imageview?
They both seem to just hide the imageview. I would like to completely remove the imageview under certain circumstances.
removeFromSuperview
hidden
Hidden makes the view hidden/untouchable - it's akin to making the alpha equal to 0.
removeFromSuperview removes the view completely from its superview.
The two are pretty different, so it really depends on what you want. If you plan on temporarily hiding the view, then making it hidden is probably what you want. If you want to remove it and have no plans on adding it again (at least within the view controller's lifecycle), then removeFromSuperview is better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With