A

Admin • 670.22K Points
Coach

Q. What does the `@discardableResult` attribute do?

  • (A) Ignores errors in a function
  • (B) Allows a function’s return value to be unused
  • (C) Suppresses compiler warnings
  • (D) Prevents unwrapping of optionals
  • Correct Answer - Option(B)
  • Views: 2
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
`@discardableResult` tells the compiler it's okay if the function result is ignored.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.