Created
January 17, 2018 03:51
-
-
Save lilyball/de778eca5bbf74076027af457907b590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dict = UserDefaults.standard.dictionary(forKey: String(key)) ?? [:] | |
var result = Dictionary<Int,Bool>(minimumCapacity: dict.count) | |
for (key, value) in dict { | |
guard let intKey = key as? Int, | |
let boolValue = value as? Bool | |
else { continue } | |
result[intKey] = boolValue | |
} | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment