vendredi 20 mars 2020

Swift UI - ReferencerTester.swift File. Receiving Error while trying to append to an array

I am trying to add and instance of Class Wave to my instance of class WaveList

I don't know why I am unable to simply append this within my Test File.

My Classes look like this:

class Wave {
var name: String
var country: String
var type: String
var left: String
var right: String
var image: String

init(name: String, country: String, type: String, left: String, right: String, image: String){
    self.name = name
    self.country = country
    self.type = type
    self.left = left
    self.right = right
    self.image = image
}


class WaveList{
var waves: [Wave] = []

func addWave(wave: Wave){
    self.waves.append(wave)
}

Thank You

Test File

Aucun commentaire:

Enregistrer un commentaire