Is there any way I can simplify this:
var unloadedImagesRows = [String:[Int]]()
private func addToUnloadedImagesRow(row: Int, forLocation:String!) {
if unloadedImagesRows[forLocation] == nil {
unloadedImagesRows[forLocation] = [Int]()
}
unloadedImagesRows[forLocation]!.append(row)
}
Doesn't Swift have an easy way to check for nil
, and if so, create a new object, and all subsequent uses refers to the object?