caipivara
2/3/2015 - 3:35 PM

clearAll function for NSUserDefaults

clearAll function for NSUserDefaults

extension NSUserDefaults {
	
	func clearAll() {
		
		let dictionary = self.dictionaryRepresentation()
		
		for (item, value) in dictionary {
			let key = item as String
			removeObjectForKey(key)
		}
		
		self.synchronize()
		
	}
	
}