Is this self-initializing variable initialized at app launch, or initialized when it is first called upon by an executing code?

What is this type of variable (specifically constant) declaration called that initializes itself with a "stored procedure" with code within curly braces followed by an empty set of parentheses? I don't know what key words to search for.

let object: NSObject = {
  let nestedObject = NSObject()
  return nestedObject
}()

I want to know if that variable gets initialized when it's needed the first time if I declare it globally in a swift file outside any other scope, or if it is initialized when the iOS app starts up before the variable is even called.

I thought the code within the curly braces runs when the iOS app launches, thus initializing the value of the variable, but I got an run time error while debugging my Xcode project when such a variable is called for the first time. I got a runtime error that says:

EXC_BREAKPOINT (code=1, subcode=0x...)

I also was told at one time in a question I posted on stackoverflow that the code runs only once.

Where it it declared ? In a class ? Inside a func ?

If in a class, it should be executed when class is instantiated. If in a func, when func is called.

To understand better what happens, add a log:

let object: NSObject = {
  let nestedObject = NSObject()
  print("nestedObject created") 
  return nestedObject
}()
Is this self-initializing variable initialized at app launch, or initialized when it is first called upon by an executing code?
 
 
Q