I have Struct init and I'm trying to filter the an array in init:
public struct doSomething: Codable {
public var listOfStuff: [String]
init(someStuff: [String]) {
var clone = someStuff
let stuff: [String] = clone.removeAll { $0 == "myName"}
listOfStuff = stuff
}
}
On this line let stuff: [String] = clone.removeAll { $0 == "myName"}
I'm getting this error:
error: cannot convert value of type '()' to specified type '[String]
Any of you knows why I'm getting this error or if you know a work around?
I'll really appreciate your help.