Dardila11
8/8/2018 - 1:02 AM

Arrays & structs

How to create an empty array. How to create Array of Structs

struct myStruct {
    var var1: String
    var var2: String
}

var myArray = [String]() // Create empty Array of Strings
myArray.append(myStruct(var1: "dog", var2: "A dog says")) // Add new element of type myStruct to myArray