ACKOnDemandWindower and date ranges?


How do I use the ACKOnDemandWindower with SChartDateRange? I want to display an initial window of one years data. How do I accomplish this?

This is the code I tried now:

let now = Date(); let oneYearAgo = now.addingTimeInterval(-(3600*24*365)) let xRange = SChartDateRange(dateMinimum: oneYearAgo, dateMaximum: Date()) let dataSource = ACKOnDemandWindower(windowSize: 1 , datasource: dataSource, on: self.chartView, initialWindowedRange: xRange, managedAxis: xAxis, isXAxis: true)

However, the last line ACKOnDemandWindower constructor crashes with the following stacktrace

2016-11-30 14:05:42.460010 myApp[4543:1220251] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x174226960'


Nevermind. I can just use the chart defaultrange to get the effect I am looking for.