Posts

Post not yet marked as solved
2 Replies
321 Views
Hello, I would like to create an app, which helps people to learn a language. The app content I would like to change using text files. As beginner in SWIFT programming I would need a hint how to pass new content in my app. I thought to use text files, placed on a web site. If the text file is updated, the app should get the newest content automatically. Does this make sense? What would be the best solution to achieve this target? Is there any helpful video in the "Developer" app or somewhere else? Thanks a lot.
Posted Last updated
.
Post not yet marked as solved
2 Replies
545 Views
There are several posts already. But none helps me in my task. Sometimes error message appears: "The file "Text.strings" couldn't be opened using text encoding Unicode (UTF-8)." Sometimes the text is shown in strange format. Why? import Foundation func printLine() -> String {     let filename = "Text"     var text: String     var myCounter: Int          guard let file = Bundle.main.url(forResource: filename, withExtension: "strings")     else {         fatalError("Couldn't find \(filename) in main bundle.")     }     do {         let contents = try String(contentsOf: file, encoding: String.Encoding.utf8 )         let lines = contents.split(separator:"\n")         print(contents)         print(lines)         myCounter = lines.count         print(myCounter)         text = String(myCounter)         } catch {             return (error.localizedDescription)         }         return text } This is the content of the text file: "Text 1"; "Text 2"; "Text 3";
Posted Last updated
.
Post not yet marked as solved
2 Replies
235 Views
I learn how to code. The guided project "Personality Quiz" of the book "App development with swift" ios11 Edition Xcode 9 troubles me. Those lines show no effect in the simulator:         singleStackView.isHidden = true         multipleStackView.isHidden = true         rangedStackView.isHidden = true Why?
Posted Last updated
.