【发布时间】:2018-04-12 09:03:16
【问题描述】:
var monthsOfNonWorking = ["1. mēnesis","2. mēnesis","3. mēnesis","4. mēnesis","5. mēnesis","6. mēnesis","7. mēnesis","8. mēnesis","9. mēnesis",]
@IBAction func nonWorkingAllowanceCalculate(_ sender: Any) {
var firstThreeMonths :Double
var secondThreeMonths :Double
var LastThreeMonths :Double
let bezdarbienieka_alga = Double(bezd_alga.text!)
if (staza_masiva_lasisana == 0) {
firstThreeMonths = Double(bezdarbienieka_alga! / 2)
secondThreeMonths = Double(firstThreeMonths / 2)
LastThreeMonths = Double(bezdarbienieka_alga! / 1.6 - secondThreeMonths) }}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! MonthTableViewCell
switch indexPath.row {
case 0: cell.nonWorkingAllowance?.text = String()
}
cell.monthLabel?.text = monthsOfNonWorking[indexPath.row]
return cell
}
如何在使用按钮操作计算后在表格视图单元格上显示结果?
比如我想在tableViewCell上显示数据firstThreeMonths?
【问题讨论】:
标签: ios swift xcode uitableview tableview