in objective-c we can declare variable like
-NSString *a,*b,*c;
in swift there a way to declare same datatype multiple variable variable rather than doing l
Swift has an odd design decision here. Placing a type on a variable affects all previous non-explicitly typed variables in a multi-line definition. Same for constants.
These two lines are equivalent (a, b and c are Double):
var a, b, c: Double
var a: Double, b: Double, c: Double
And these two are equivalent (a and b are Int, while c and d are Double):
var a, b: Int, c, d: Double
var a: Int, b: Int, c: Double, d: Double