[Type]
instead of Array<Type>
SW-C1003Using the shorthand syntactic sugar for defining arrays, i.e., []
instead of Array
, can make the code more concise and readable. Here are some reasons why:
Type names in Swift should follow a specific convention to ensure consistency and readability of the codebase. In particular, type names should
Using shorthand syntax for optional binding can improve the readability and conciseness of your code. The shorthand syntax involves using the if let
or guard let
statements to bind optional values instead of the longer form of
Generic type names should adhere to a specific naming convention in Swift. The name should only contain alphanumeric characters, start with an uppercase character, and span between 1 and 20 characters in length. This is important