I had just finished the final touches to my swift app. But after upgrading to Beta 7 its giving me errors for the \'ContentOfFile\' String. can anyone help me understand how I c
You need to implement do try catch error handling. Try like this:
edit/update:
Swift 3 or later
if let fileURL = Bundle.main.url(forResource: "Chapters", withExtension: "txt") {
do {
let string = try String(contentsOf: fileURL, encoding: .utf8)
var chapters = string.components(separatedBy: "@")
chapters.removeFirst()
} catch {
print(error)
}
}