Named Objects vs Objects created “on the fly”

Hi,

 

In Swift Playgrounds it is shown how to create e.g. an Object as an Instance of a Class like: let gem =  Gem() giving the object a name or create an Instance “on the fly” like: world.place(Gem(), atColumn: 2, row: 5). The first Object created with a name can be used by using its name and its properties and methods. But how is the Object used being created “on the fly” when there is not name for that Object?

 

Hope above stated makes sense?

 

Best,

Thomas

Powered by WPeMatico

About

You may also like...

Comments are closed.