Key-Value Coding (KVC) with Array/Dictionary in Swift
问题 Is it possible to key-value code (KVC) with native Swift data structures such as Array and Dictionary? Key-Value coding is still available for NSFoundation structures within Swift, just like in Objective C. For example, this is valid: var nsarray: NSArray = NSArray() // Fill the array with objects var array: NSArray = nsarray.valueForKeyPath("key.path") But this is invalid: var swiftarray: Array = [] // Fill the array with objects var array = swiftarray.valueForKeyPath("key.path") // Invalid,