 
 public func events(byColor: Bool = false) -> YapDB.Fetch {
 
-    let grouping: YapDB.View.Grouping = .ByObject({ (collection, key, object) -> String! in
+    let grouping: YapDB.View.Grouping = .ByObject({ (_, collection, key, object) -> String! in
         if collection == Event.collection {
             if !byColor {
                 return collection

        return .None
    })

    let sorting: YapDB.View.Sorting = .ByObject({ (group, collection1, key1, object1, collection2, key2, object2) -> NSComparisonResult in
        if  let event1 = Event.unarchive(object1),
            let event2 = Event.unarchive(object2) {
                return event1.date.compare(event2.date)


public func eventsWithColor(color: Event.Color, byColor: Bool = false) -> YapDB.Fetch {

    let filtering: YapDB.Filter.Filtering = .ByObject({ (_, group, collection, key, object) -> Bool in
        if let event = Event.unarchive(object) {
            return event.color == color
        }
