re: My first week of learning Swift. VIEW POST

FULL DISCUSSION
 

in 7) What you really should do to print the "name", is unwrapping the optional with Optional Binding (if-let) Example:

if let name = name {
       print(name)
}

With this approach, you don't need to verify first if it is nil and then force unwrap it. (Normally force unwrapping things in swift is a bad practice, unless is Outlets or if you don't have any other option for some kind of reason)

 

Perfect. That's a great input.

I have updated the article now.

code of conduct - report abuse