return
keyword. Don't add semicolons except where syntactically demanded in statements or to separate statements on the same line.var
when let
is appropriate, especially for properties. The compiler better optimizes let
statements for items whose values will not change during their lifetime. For example, Apple writes, "It is good practice to create immutable collections in all cases where the collection does not need to change. Doing so enables the Swift compiler to optimize the performance of the collections you create."get
clauses (for properties), anonymous arguments (e.g. $0, skipping the type in bits for closures), etc to clean up your code.CGPointMake()
. Prefer Swift constructors and initializers over legacy ones.Thanks, Kevin Ballard