Swift vs Groovy – Types

Getting started Swift types

Int Integer, whole number that does not containing any floating point information.Float 32bit number with floating point informationDouble 64bit number with floating point informationBool true or falseString represents textCharacter Single unicode character

There are more types but those are the most common in Swift.

Type Naming

Swift Types and the types you defined should be UpperCamelCase. Same in Groovy. However, in Groovy we have access to java primitives short, int , long, float, double, byte, char, boolean etc. Those are lowercase.

Type inference

If we don’t explicitly defined a type both Swift and Groovy will try to infer it.