Post marked as solved
Post marked as solved with 1 replies, 1,407 views
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")