Question: ```
[ $var -eq $val ]

```

What will be the value of `$?` after the above condition/test if it fails? Can I assume that it will **always** be `1`?

Edit: After reading answers I realized my question wasn't precise. I meant "will it be always `1` if no error occurs?".

Answer: 
`setHomIconDict` is not `Dictionary` it is an Array of tuple and you are getting this crash because you haven't initialized the `setHomIconDict` object, you have just declared its type. So initialized it with its declaration. 

```
var setHomIconDict:[(iconImg: UIImage, Operator: String, oprCode: String, oprMerchCode:String)] = []

```

**Note:** Instead of creating array of tuple better solution is to create one custom model `Class` with the property that you want to `set/access`, then create array of that custom `Class` objects and use it.
As Nirav says, the syntax you are using creates an array of tuples. If you want a dictionary get rid of the parentheses.

You want to define key/value pairs using this syntax:

```
var aDict = [key:value, key:value, key:value] 

```

Then you can add new key/value pairs using:

```
aDict[newKey] = newValue

```

Is your goal to create and use a dictionary, or is it your goal to user and understand the structure that you found on the net?