Hi there,
I downloaded this code from hackingwithswift.com, but it always fails at loading the file. Does anyone have an idea what might cause this problem? Here's my code:if let filepath = Bundle.main.path(forResource: "german", ofType: "dic") {
do {
contents = try String(contentsOfFile: filepath)
print(contents)
} catch {
print("contents could not be loaded")
}
} else {
print("file not found")
}
text = contents.components(separatedBy: "\n")
2
0
4.4k