SwiftyConfiguration
SwiftyConfiguration copied to clipboard
keep code safe
this part is not safe. ps: how about use 'subscript' instead of separatedKeys
var object: AnyObject = dictionary
key.separatedKeys.enumerated().forEach { idx, separatedKey in
if let index = Int(separatedKey) {
let array = object as! Array<AnyObject>
object = array[index]
} else {
let dictionary = object as! NSDictionary
object = dictionary[separatedKey]! as AnyObject
}
}