Is there a difference between these two statements?
view.backgroundColor = .clear
view.backgroundColor = nil
I always use the latter, but I mostly see people using UIColor.clear
whenever they want to make the background clear. Is there actually a difference?
No there isn't as the default is transpartent = clear
see in Docs
@NSCopying var backgroundColor: UIColor? { get set }
Changes to this property can be animated. The default value is nil, which results in a transparent background color.
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