I have a structural variable that is wrapped in a class NSObject
.
Here's what it looks like:
class myClass: NSObject{
struct myStruct {
var array1: [String]
var additionalInfo: String?
var array2: [String]
}
var myVar = [myStruct(array: ["value1"], additionalInfo:nil, array2: ["value1","value2"])]
}
My goal is to add a variable myVar
with values from another class and access them.
I am trying to add this code:
var classAccess = myClass()
classAccess.myVar.append(array1:["value 3"], additionalInfo:nil, answers:["value 3"])
However, when I try to compile, I get all kinds of nasty errors.
How do you access it properly?
source
share