From a63997fa09fa3281112778dbcd1a6be9a3de5215 Mon Sep 17 00:00:00 2001 From: "Christiano, Kevin" Date: Tue, 7 May 2019 14:08:24 -0400 Subject: [PATCH] correction. --- MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift index 0ffad8d..baf1d18 100644 --- a/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift +++ b/MVMCore/MVMCore/Categories/Dictionary+MFConvenience.swift @@ -66,7 +66,9 @@ public extension Dictionary { /// Returns a String after looking up the specified key. Nil will be returned if a string for the key does not exist func optionalStringForKey(_ key: String) -> String? { - return objectChainOfKeysOrIndexes([key]) as? String + guard let key = key as? Key else { return nil } + + return self[key] as? String } /// Returns an Array after looking up the specified key. An empty array will be returned if an array for the key does not exist @@ -118,7 +120,9 @@ public extension Dictionary { /// Return a float from a string created by looking up the specified key. This will return 0.0 if the key does not exist func floatForKey(_ key: String) -> Float { - return objectChainOfKeysOrIndexes([key]) as? Float ?? 0.0 + guard let key = key as? Key else { return 0.0 } + + return self[key] as? Float ?? 0.0 } func optionalCGFloatForKey(_ key: String) -> CGFloat? {