How to read settings.bundle with Xcode7 + Swift 2

Hello,


I am trying to read the user settings in my app.


using :

let settings = NSUserDefaults.standardUserDefaults()
let value = settings.stringForKey("key")! as String!


not working


can someone please refer me to alink that explain how to read the users setting

Describe 'not working'.


What you did, what you expected, how those differ. Be sure to include any warnings, errors or nslog console output.

There's an easier way than suggested by sir RLKingSoftware.

Call this when your app starts.

UserDefaults.standard.register(defaults: ["key" : "value"])

Additional reading http://dscoder.com/defaults.html

How to read settings.bundle with Xcode7 + Swift 2
 
 
Q