Cell VC ---->
@IBAction func datePickerTapped(_ sender: Any) {
DatePickerDialog().show("DatePickerDialog", doneButtonTitle: "Done", cancelButtonTitle: "Cancel", datePickerMode: .date) { (date) in
if let dt = date {
let formatter = DateFormatter()
formatter.dateFormat = "dd-MM-yyyy"
let result = formatter.string(from: dt)
self.buttonDate.setTitle("\(result)",for: .normal)
}
}
}
家长VC ---->
let Cell = tableView.dequeueReusableCell(withIdentifier: "Cell2", for: indexPath)as! TwoProfitTableViewCell
let date = Date()
let formatter = DateFormatter()
formatter.dateFormat = "dd.MM.yyyy"
let result = formatter.string(from: date)
if self.responseApi.count > 0
{
Cell.Chart_View.chartDescription?.text = self.responseApi["graph_data"]["axis_data"]["axisname"].stringValue
Cell.Chart_View.legend.enabled=true
Cell.Chart_View.highlightPerDragEnabled = false
Cell.Chart_View.animate(xAxisDuration: 2.0, yAxisDuration: 2.0)
Cell.Chart_View.leftAxis.drawLabelsEnabled = true
Cell.Chart_View.leftAxis.enabled = true
Cell.Chart_View.rightAxis.drawLabelsEnabled = true
Cell.Chart_View.rightAxis.enabled = true
Cell.Cmlt_prft.text = " ₹ Cumulative Profit :- Rs.\(self.responseApi["graph_data"]["stats"]["cumulativeprofit"] .stringValue)"
Cell.prft.text = " ₹ Profit of \(result) :- Rs.\(self.responseApi["graph_data"]["stats"]["profit"] .stringValue)"
setChart(Cell.Chart_View,dataPoints:block_val, values: breakeven_price_val)
}
Cell.selectionStyle = .none
return Cell
parent cell label
我希望复制picker value
cell viewcontroller