I tried to converting a string into an array, but its showing error
var boolean = "01101010101001010111"
i tried to spilt the string by characters it didn't worked and tried to convert it into array.
resultArray = [0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1]
My code attempt
boolean = "01101010101001010111"
let componentsArray = boolean.components(separatedBy: .controlCharacters)
resultArray = Array(componentsArray) as! [Int]
And the error
Error: Generic parameter "Element could not be inferred"
let resultArray = boolean.characters.flatMap{Int(String($0))}