I have an array of core data entities, named TradingDayPrices, with 1 date and 4 double attributes. I would like to be able to copy the date value and 1 specific double into a new array. I have not been able to determine the correct syntax. With the code below I get the error "cannot assign value of type [[Any]] to type [Date:Double]"
var allClosingValues: [TradingDayPrices]
var closingValues: [Date:Double]
var selection: DataDisplayed
init(selection: DataDisplayed, allClosingValues: [TradingDayPrices]) {
self.selection = selection
self.allClosingValues = allClosingValues
switch selection {
case .VOODT:
closingValues = allClosingValues.map {
[$0.timeStamp! , $0.vooClose]
}
default:
let _ = print("Error in Data Table Structure")
}
}