Created
October 16, 2019 10:51
-
-
Save TheiOSDude/9f505ce0ec8810877f1f9b5a4057ae30 to your computer and use it in GitHub Desktop.
Highlighting an important, yet probably overlooked, instance method on NSDictionary where the key starts with '@'
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
import UIKit | |
var dictionary = NSMutableDictionary() | |
let key = "@123" | |
dictionary[key] = "Test Value" | |
let value = dictionary[key] // Test Value | |
let newKey = "@4321" | |
dictionary[newKey] = "New Test Value" | |
let newValue = dictionary.value(forKey: newKey) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment