Pergunta de entrevista da empresa Arthrex

What does forced unwrapping mean? What does the syntax look like?

Resposta da entrevista

Sigiloso

14 de mai. de 2017

If you know your variable is going to be an optional (and that it’s not going to be nil), simply add an exclamation point to it to get at the true value. For example: print(“\(myName!)”) will print out “GlassdoorCommenter” instead of “Optional(“GlassdoorCommenter”))” into the Xcode console.