Skip to content

Instantly share code, notes, and snippets.

@TheiOSDude
Created October 16, 2019 10:51
Show Gist options
  • Save TheiOSDude/9f505ce0ec8810877f1f9b5a4057ae30 to your computer and use it in GitHub Desktop.
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 '@'
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