0

I'm porting my android app to iOS. In android I have the asset folder I can manage through the studio and where all my config files reside.

Where should reside my txt config files in Xcode: Supporting files, Poducts, xcassets, ...?

What should I use to open/read the files? Should I use the following constants?

   let fileManager = NSFileManager.defaultManager()
   let currDir = fileManager.currentDirectoryPath

is there a good article/tuto you recommend to read?

many thanks!!!

narb
  • 958
  • 1
  • 13
  • 39

1 Answers1

1

This isn't a cross-platform way of doing things, and as such won't answer your question directly, but if you wanted to do things "the Apple way", see this: http://www.myswiftjourney.me/2014/10/01/simple-persistent-storage-using-nsuserdefaults/

You shouldn't need to worry about raw file access if you're only saving config values.

Marc Fearby
  • 1,305
  • 1
  • 13
  • 28
  • I might not have been clear in my request. Persistent storage between restart is interesting but at the moment I need to take care about the initialization first. For example one the thing that does my app is showing a list of author and extract a short display of the novel. Ex: London, Poe, Wilde, etc... And this config shows the text associated that I need to display. So where do I put all of that in Xcode (config file + text of the novel)? How do I open it programmatically? – narb Aug 12 '15 at 12:17
  • examples of raw reading and writing to files can be seen here: http://stackoverflow.com/questions/24097826/read-and-write-data-from-text-file – Marc Fearby Aug 13 '15 at 10:46