私はiPhone用のスウィフトでTodoアプリを作成しています。私は、テーブルビューにタスクの名前と時間を表示するようにテーブルビューを設定します。 Textlabelはタスクの正しい名前を表示しますが、detailTextLabelは時刻ではなく詳細のみを表示します。スワイプのテーブルビューdetailTextLabel
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCell(withIdentifier: "cell") as UITableViewCell!
let task = tasks[indexPath.row]
if task.done {
cell?.textLabel!.text = "‼️\(task.name!)"
task.time = cell!.detailTextLabel!.text
} else {
cell?.textLabel!.text = "\(task.name!)"
task.time = cell!.detailTextLabel!.text
}
return cell!
}
はThaks男。それを見たことがない:D – tc34
問題はありません!それが解決された場合は、回答としてマークしてください。 (それはした;) – TheValyreanGroup