Swift Code Syntax : Important Cheat sheet & references for Swift programmers
There’s a lot of new syntax in Swift, so we thought it might be useful if we put together a cheat sheet/quick reference on this particular language. Without further ado, let’s see what are they: 1. No .h and .m file, only one file with .swift extension 2. No semicolon at the end of the statement 3. No @ for literal strings 4. No pointers. So, no use of asterisk 5. Cannot use ’nil’ with non-optional variables or constants 6. No Mutable or Immutable concepts, var use to declare mutable and let use to declare immutable data type. 7. In swift, strings are value type not object type. 8. Constants declared as ‘let’ and variables with ‘var’ 9. Declaration and initialisation i.e. var message. For example, String= “Hello” 10. Multiple declaration i.e. var red, green,blue i.e. Double 11. Print to console i.e. println(“Print”) 12. String interpolation i.e. \(variable_name)”) 13. No parenthesis for if i.e. if age < 60 14. Assertion i.e. assert(age >= 0, “A perso...