Why does each neuron generate the same UUID when I instance a new one? [duplicate]

Solution 1:

You are not generating a new instance. You are repeating the same instance in your collection. If you would like to create new instances you would need to create a range and map your struct initializer.

let layer = (1...5).map { _ in Neuron() }