diff --git a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift index cab84d0..46dbc01 100644 --- a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift +++ b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift @@ -52,6 +52,10 @@ public extension Dictionary { return array } + func optionalArrayForChainOfKeysOrIndexes(_ keysOrIndexes: [Any]) -> [Any]? { + return objectChainOfKeysOrIndexes(keysOrIndexes) as? [Any] + } + /// Returns a Dictionary after looking up the specified key. An empty dictionary is returned if a dictionary for the key does not exist func dictionaryForKey(_ key : String) -> [String : Any] { @@ -76,6 +80,10 @@ public extension Dictionary { return arrayForChainOfKeysOrIndexes([key]) } + func optionalArrayForKey(_ key : String) -> [Any]? { + return optionalArrayForChainOfKeysOrIndexes([key]) + } + /// Return a Bool after looking up the specified key. This will return false if the key does not exist func boolForKey(_ key : String) -> Bool {