想要将数据从一个单元格按钮传输或复制到同一个tableview的另一个单元格标签

时间:2017-03-28 11:20:16

标签: ios swift uitableview

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

0 个答案:

没有答案