All Questions
16 questions
0
votes
3
answers
166
views
Append a dictionary array to another dictionary array in Swift
I have two quote dictionaries I'm trying to append after an in-app purchase. I have tried several different methods to append the dictionaries together but I'm still getting an error "No exact ...
0
votes
0
answers
131
views
Swift array seems to not be appending
This question is pretty elementary but I am a beginner to Swift and any help would be appreciated. I am building an app where when the user presses a button from the menu page, it appends an array, ...
0
votes
1
answer
661
views
How to append Dictionary value in Swift
I'm trying to save daily data to a Dictionary. When the user reaches 100% of their daily progress I want to add that day and a "true" value with it into a Dictionary.
The problem is, when I ...
0
votes
1
answer
273
views
appending key value pair to existing dictionary values in swift
I'm trying achieve below results. Where I can save multiple key values for multiple string items.
//dict["Setting1"] = ["key1":"val1"]
//dict["Setting1"] = [&...
1
vote
1
answer
36
views
How to append to [[String : [String]]] = [[:]] instead of [String : [String]] = [:]?
I am getting list of arrays from Firestore database and appending the, to the following variable:
var productTags : [String : [String]] = [:]
This is my code for getting the data and appending it ...
1
vote
1
answer
2k
views
Append an array of dictionaries
I am trying to append an array of dictionaries with latitude and longitude.
This is because I want to add annotations to a map, But I am getting the data from Firebase and need to store them in an ...
-1
votes
5
answers
2k
views
Dictionary append not working in Swift
Why is append(data) not working?
import Foundation
//This is working.
let tablelist:[String: String] = [
"red1": "manu1",
"blue1": "chelsea1",
"yellow1": "dort1",
"green1": "...
0
votes
1
answer
138
views
Arrays as values in a Dictionary in Swift: Cannot append values
I want a function to append an object Something to an array of Somethings, as a value inside a Dictionary. If the key does not exist, I want to create it. If theDictionary[aCategory] is empty, It wont ...
0
votes
1
answer
13k
views
Append to Dictionary in Swift
I'm trying to do a very easy task, add an item to a dictionary using "append".
This is the dict:
var myDictionary: [String:Int] = [
"Apple" : 1,
"Banana" : 2,
"Strawberry" : 3
]
I've tried this
...
0
votes
1
answer
417
views
SWIFT append data to dictionary
I'm having trouble coding an apparently simple task. I want to add new client profile data to a client profile dictionary (clientDatabase) but keep getting errors - can't seem to append - error: ...
0
votes
3
answers
257
views
SWIFT - Append Int to array in NSUser Default Dictionary
I have a NSUserDefault dictionary. One of the keys has a value of type [Int]. I'm looking to figure out how to append Ints to that embedded array.
var dictionary = ["keyOne" : [1,2,3,4,5]]
defaults....
0
votes
1
answer
516
views
How to take a slice of an array / dictionary and append
I have an array / dictionary of testWords that is pulled from a plist. I want to randomly shuffle them, take a slice of 2 and append that to another words array. For some reason I can't append the ...
0
votes
1
answer
164
views
Appending to Array in Deeply Nested Dictionary of Arrays
I am having the following problem in Swift. First, I declare a data structure, like this:
var books = [String : Dictionary<String, Dictionary<String, Dictionary<String, Array<Dictionary&...
2
votes
2
answers
172
views
Trying to append dictionary in Swift [duplicate]
I am trying to create then append a dictionary but I am getting the following error I can't solve: Cannot subscript a value of type '[String: AnyObject]?' with an index of type 'String'
Anyone has an ...
1
vote
2
answers
889
views
Swift: Appending to Dictionary
I am stuck with an issue with trying to append a Dictionary in swift. I am trying to log every time a button is pressed, along with the time.
I have two buttons, each with their own IBAction, here's ...
0
votes
2
answers
34
views
Adding an object to a [String: [[String]]] dictionary
I have a dictionary:
var dictionary: [String: [[String]]] = [
"Janvier": [ ["", ""] ],
"Février": [ ["", ""] ],
"Mars": [ ["", ""] ],
"Avril": [ ["", ""] ],
"Mai": [ ["", ""] ],
...