This might be a crazy question, but its something that has been bugging me this week. In Swift if you have an optional instance of a class does setting that optional to nil call deinit (if implemented) or do any cleanup on the instance?
// OPTIONAL INSTANCE OF PLANET
var newPlanet: Planet? = Planet(name: "Earth", atmosphere: "Oxygen")
if let planet = newPlanet {
planet.description()
}
newPlanet = nil
I am assuming that after setting the pointer to nil that particular instance of Planet is no longer accessible?