A

Admin • 802.91K Points
Coach

Q. What is the use of `defer` in Swift?

  • (A) To delay function call
  • (B) To define async code
  • (C) To schedule clean-up code to run before scope exit
  • (D) To pause execution
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Admin
`defer` ensures that the block runs when the current scope is exited.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.