Pergunta de entrevista da empresa Arthrex

What is an optional in the Swift language and explain how it is implemented?

Resposta da entrevista

Sigiloso

14 de mai. de 2017

This is another Swift feature that anyone who does Swift will have experience with, but might not remember the actual formal name. Simply add a question mark to the end of the type to allow that variable to also be nil. That is, “var myName : String?” allows the variable to either be a string or nil.