我有这个结构
struct Question {
let answer : String
let questionText : String
}
然后我有一个这个结构的数组
var questions = [Question]()
如何从.txt文件中读取数组(因为我有300多行数组)?
questions = [
Question(answer:"Lorem ipsum dolor sit amet",questionText:"Lorem ipsum dolor sit amet"),
Question(answer:"Lorem ipsum dolor sit amet",questionText:"Lorem ipsum dolor sit amet"),
...
]