I'm just starting Swift. Can someone please explain to me why I can pass array as an argument (byRoundingCorners:)
UIBezierPath(
roundedRect: self.bounds,
byRoundingCorners: [.topLeft, .bottomLeft],
cornerRadii: CGSize(width: radius, height: radius))
But passing it in variable, produces error
var corners = [UIRectCorner.topLeft, UIRectCorner.bottomLeft]
let path = UIBezierPath(
roundedRect: self.bounds,
byRoundingCorners: corners,
cornerRadii: CGSize(width: radius, height: radius))
"Cannot convert value of type '[UIRectCorner]' to expected argument type 'UIRectCorner'"