Get Updates By E-mail 

Article Written By:
Johann Dowa

SwiftyConfiguration – Library Providing A Simple Swift Based Syntax For Accessing PList Values

  •  
  •  
  •  
  •  
  •  

SwiftyConfiguration from kyo__hei provides a clean Swift based API for working with your Plist files.

With SwiftyConfiguration you simply define the values within your Plist files within an extension, and then you can access the plist file values directly using the included get function.

After defining your Plist file in Swift you can access the keys like in this example for the readme:

let plistPath = NSBundle.mainBundle().pathForResource("Configuration", ofType: "plist")!
let config = Configuration(plistPath: plistPath)!

// You can get a plist value to type-safe.
let stringValue      = config.get(.string)!
let urlValue         = config.get(.url)!
let numberValue      = config.get(.number)!
let intValue         = config.get(.int)!
let floatValue       = config.get(.float)!
let doubleValue      = config.get(.double)!
let dateValue        = config.get(.date)!
let boolValue        = config.get(.bool)!
let arrayValue       = config.get(.array)!
let dictionaryValue  = config.get(.dictionary)!
let innerIntValue    = config.get(.innerInt)!
let innerArrayValue  = config.get(.innerArray)!
let innerStringValue = config.get(.innerString)!

You can find SwiftyConfiguration on Github here.

A nice simple way to access Plist file values in Swift.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments