First of all, assignment is not giving the object a name.
This line:
let gem = Gem()
Creates a box with a name `gem` and put a new instace of `Gem` into the box.
If you declared an instance property like this:
var gem = Gem()
Creates a box with a name `gem` (the box is not sealed), and put a new instace of `Gem` into the box.
Later you would assign another new instance to the property somewhere in an instance method:
func aMethod() {
...
gem = Gem()
...
}
Then the old instance is gone, and the newly created instance is put in the box.
So, it is important that how you get the content of the box.
In case of instance property, just write the name of the box, and you can use the content of the box. (In some cases, you need to write `self.`)
gem.aMethodForGem()
The method is called on the current content of the box, not on the first instance created as the initial value.
But in the case of your "on the fly", `world` may prepare a box to store the instance and put the passed instance into it.
How you get the content of the box?
If `world` provides an method to get the content for `place`d instances, for example, if it had a method named `gem(atColumn:row:)`, you might use it like:
world.gem(atColumn: 2, row: 5).aMethodForGem()
When there's no such method in `world`, you may need prepare a box to keep the instance yourself:
var keptGem: Gem?
keptGem = Gem()
world.place(keptGem, atColumn: 2, row: 5)
if let theGem = keptGem {
theGem.aMethodForGem()
}