To be able to access the optional’s value one must unwrap it. The optional value can be unwrapped by programmer either safely or forcibly. If you want to forceunwrap the optional and it does not have any value then your program will certainly crash and will show you the above error message.
If you are using the Xcode then it will show you the crash by properly highlighting the line of code on which the problem is occurring.
The Explicit Force Unwrapping:
This is usually done by a ! operator on the optional.
let yourOptionalString: String?
print(yourOptionalString!) // <- On this line of code crash will occur.
Fatal error: Unexpectedly found nil while unwrapping an Optional value
In above example the
nil so you will face the crash on above line where you have tried to force unwrap it.
Hope you understood it.