A

Admin • 833.24K Points
Coach

Q. How do you declare a variable in Swift that must always hold a value (non-optional)?

  • (A) let name: String?
  • (B) var name: String
  • (C) let name: Optional<String>
  • (D) var name: String?
  • Correct Answer - Option(B)
  • Views: 42
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin

Declaring without a `?` means the variable must always hold a value and cannot be nil.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.