R

Ravina • 3.96K Points
Extraordinary

Q. How do you unwrap an optional safely in Swift?

  • (A) Using * operator
  • (B) Using if let
  • (C) Using guard var
  • (D) Using throw
  • Correct Answer - Option(B)
  • Views: 16
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Ravina
`if let` is commonly used for safely unwrapping optionals to avoid runtime crashes.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.