Forums
Learn
Careers
Store
About
SUBSCRIBE
WWDC23 SALE: Save 50% on all my Swift books and bundles! >>
Question 1/12: This code will print a message when an instance of the type is destroyed – true or false?
Hint: Structs cannot have deinitializers. Click to show.
struct Olympics { func deinit() { print("And now for the closing ceremony.") } }
Correct! You don't use func or write parentheses after deinit.
func
deinit
Oops – that's not correct. You don't use func or write parentheses after deinit.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.