use a dictionary.
var listArr = ["arr1","arr2","arr3","arr4"]
arrays = {"arr1": ["aa", "bb"], "arr2": ["aaa", "bbb"]}
let test1 = arrays[listArr[0]]
solved “SWIFT” string to name array
use a dictionary.
var listArr = ["arr1","arr2","arr3","arr4"]
arrays = {"arr1": ["aa", "bb"], "arr2": ["aaa", "bbb"]}
let test1 = arrays[listArr[0]]
solved “SWIFT” string to name array