Q:

Why would you use an optional type for a constant with value?

Have a look at this statement from Apple document:
let optionalInt: Int? = 9

Why would you use Int? as the type for this constant? You know that it cannot be nil as you are assigning the value 9 to it? The purpose of an optional type (as I understand) is to be able to hold nil. There is no need for optionalInt to hold nil in this statement. Could someone explain?

A:

I found a case where you might use it. It's a bit of a stretch, but here we go.
One reason for using let x: Int? = whatever is if you have an overloaded function where the parameters are different types only insofar as one is an optional. For example:
func doSomething(x: Int)
{
    print("\(x) is an Int")
}

func doSomething(x: Int?)
{
    print("\(x) is an optional")
}

If you want to ensure the second overload is called, you need to make the parameter explicitly an optional e.g.
let y = 5
doSomething(y) // prints 5 is an Int

let z: Int? = 6
doSomething(z) // prints Optional(6) is an optional

I've yet to see anything like this in real life. 
As regards the Apple documentation, it's just a simple example.

A:

I think this particular part of the Apples document is intended to simply illustrate the concept of optionals and nothing else.  They probably use let out of the good practice to always start with declaring let properties/variables and only switch them to var if there is an explicit need to change their values.
As to the question why would one declare let foo: Int? = 9 and not just let foo = 9.  Well, I really can not imagine where it would be needed.  Even if some API expects an Int? then you still can pass a variable of Int type to such API and Swift will implicitly convert it for you.  Perhaps, if you pass it to a generic function and you want the Int? version of that generic to be used then you will want to do that, but it's way too academic already to have practical use.

