What is the `?` is or the `:` at the equation when coding in Swift

That’s the ternary operator

Basically it’s saying “set the corner radius of the background view to 0.4 times the frame’s height if rounded, otherwise set the corner radius to 2”.

Leave a Comment