I think the problem is with your predicate construction.
let wonPredicate = NSPredicate(format: "actualTime <= %@ && (homeScore > opponentScore)", [date])
Shouldn’t that be:
let wonPredicate = NSPredicate(format: "actualTime <= %@ && (homeScore > opponentScore)", date as NSDate)
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the help with this. Your suggestion was spot on.
I don't why it compiles in earlier versions of Swift with the date parameter as an array in the predicate initializer. That certainly didn't help to reduce the confusion when trying to convert to Swift 3.0. On the other hand, it would also be helpful if Predicate didn't translate "oneDate =< anotherDate" in predicate formats as referring to timeIntervalSinceReferenceDate, assuming that's what's going on under the covers.