How to solve "initializer for conditional binding must have optional type" in swift?

Example:

let name = "John"
if let newName = name {
    print(newName)
}
This error is seen when you try to use conditional binding on a non-optional value.

Solution:

let name: String? = "John"
if let newName = name {
    print(newName)
}

Beginner's Guide to Swift