ericasadun.com ericasadun.com

Tracking Swift Identities: #swiftlang

Swift’s deinit support makes it simple to track when instances deallocate. You can throw a print statement in there and watch when things go away. deinit { print("Deallocating instance") } If you’re going to watch object lifecycles, it helps to track which object you’re dealing with. Swift value types don’t really have identifiers. There’s no “notion of identity” for structs, enums, functions, and tuples....