« first day (1 day earlier)      last day (22 days later) » 

2:23 PM
@Alexander so if I have duplicate items, this would just get me the unique products? That's nice
but it's not working for me
`
struct Person {
let id : Int
}

var p1 = Person(id: 1)
var p2 = Person(id: 2)
var p3 = Person(id: 3)
var p4 = Person(id: 1)

let people = [p1,p2,p3,p4]

let dict = Dictionary(uniqueKeysWithValues : people.map {($0.id, $0)})`
ERROR: Fatal error: Duplicate values for key: '1'
 
 
2 hours later…
4:48 PM
notice it's "UNIQUE keys with values"
you don't have unique keys @Honey
What you're looking for is Dictionary.init(_:uniquingKeysWith:)
 

« first day (1 day earlier)      last day (22 days later) »