Hi guys
Does anyone of you know how I could make the assignment of the currentAnimal. If I leave out the = animals.first it works perfectly. Then I'm assigning in viewDidLoad().
I just wondered if it could be done during the instantiation?
Thanks once more!
Does anyone of you know how I could make the assignment of the currentAnimal. If I leave out the = animals.first it works perfectly. Then I'm assigning in viewDidLoad().
I just wondered if it could be done during the instantiation?
Code:
lazy var animals = Factory.generateAnimalArray(withNumberOfAnimals: 1000)
var currentAnimal: Animal? = animals.first
Thanks once more!