Created
May 31, 2019 02:18
-
-
Save amorphobia/5a450a0ab616b88cbe6570e4d365be0c to your computer and use it in GitHub Desktop.
Swift: Append an element to an array which is a value of a dictionary, creating a new array if needed
This file contains hidden or 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
var dict = [1: [11, 13, 15], 2: [23, 24]] | |
dict[3, default: []].append(39) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source