re: My first week of learning Swift. VIEW POST


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 {

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