I have an Array of Transaction
objects
var returnedArray: Array<Transaction> = [a, b, c, d]
One of the properties of Transaction
is an NSDate
. I want to convert my Array into a Dictionary
var transactions: [NSDate: Array<Transaction>]
Where all the transactions on that date will be in an Array that has the date as the key.
I know how to loop through each element of my array and manually assign it to the right key but i'm wondering if there is an elegant function to do that.