Pattern: Use of optional collection instead of empty collection
Issue: -
Prefer empty collection over optional collection.
Examples of correct code:
var foo: [Int]
var foo: [String: Int]
var foo: Set<String>
var foo: [String: [String: Int]]
let foo: [Int] = []
Examples of incorrect code:
↓var foo: [Int]?
↓var foo: [String: Int]?
↓var foo: Set<String>?
↓let foo: [Int]? = nil
↓let foo: [String: Int]? = nil