Clean up word loading logic

This commit is contained in:
CypherPoet 2019-01-18 15:47:23 -05:00
parent 1fced44aee
commit 9d901144a4
1 changed files with 3 additions and 1 deletions

View File

@ -41,9 +41,11 @@ class ViewController: UITableViewController {
if let pathToStartWords = Bundle.main.path(forResource: "starting-words", ofType: "txt") {
if let startWords = try? String(contentsOfFile: pathToStartWords) {
allWords = startWords.components(separatedBy: "\n")
} else {
loadDefaultWords()
}
} else {
allWords = ["silkworm"]
loadDefaultWords()
}
}