Force Unwrap
// Declare a constant which has an optional integer type
//
let a: Int? = nil
// Declare a constant with a non-optional integer type,
// which is initialized to `a` if `a` is non-nil.
// If `a` is nil, the program aborts.
//
let b: Int = a!
// The program aborts because `a` is nil.
// Declare another optional integer constant
let c: Int? = 3
// Declare a non-optional integer
// which is initialized to `c` if `a` is non-nil.
// If `c` is nil, the program aborts.
let d: Int = c!
// `d` is initialized to 3 because c isn't nil.Last updated