Question: I have a post request. I am working with the response that is stored in obj. 
The following is declared at the top `var account = Account()`, which Account() is a dictionary initialized class. 

```
var obj = response.result.value as? [String: Any]

            if response.response?.statusCode == 200 {
                let accounts = obj!["accounts"] as! [[String: Any]]
                accounts.forEach { a in
                    let acc = Account(dic: a)
                    self.account = acc
                }
            }

```

I am very confused about this syntax I don't understand yet: 
`let accounts = obj!["accounts"] as! [[String: Any]]`

I just knows this allows me to store the response into `self.account` which I can use that data to populate my view. Can someone help elaborate on what is exactly happening here? 

Thank you.

Answer: 
The `!` does a different thing when it appears in `obj!` than when it appears in `as!`.

In `obj!`, the code is [force unwrapping](https://developer.apple.com/documentation/swift/optional) (or unconditionally unwrapping) the `obj` variable. This implies that `obj` is of an optional type; we can confirm that by looking at the declaration of `obj`:

```
var obj = response.result.value as? [String: Any]

```

When the `as` operator is postfixed with a `?`, the returned value might be `nil` and thus the resulting type is an optional.

Contrast this to the second instance of a `!` in your program:

```
let accounts = obj!["accounts"] as! [[String: Any]]

```

In this instance, the `as` operator is performing a forced conversion; that means that the conversion will *always* result in a non-optional type, but it may cause a runtime error, as a result of being unable to fallback to `nil`.
```
let accounts = obj!["accounts"] as! [[String: Any]]

```

Let's decompose that line into smaller "chunks":

```
obj! // Force unwraps the object "obj" (which is a dictionary) (will crash if "obj" is nil
obj!["accounts"] // After being unwrapped tries to access the key "accounts" inside the dictionary
as! [[String: Any]]// Is going to "cast" or treat the above dictionary as an Array of Dictionaries of String: Any (again forcing it and crash if it cannot)

```

But remember!
=============

It's not a good practice to force unwrap things as your app might crash. You should always go for optional bindings or optional chaining.