0
私はUITableViewを使用して、セルを選択するときに話す言語を選択し、他のセルを選択したテーブルでスクロールダウンできるようにします。UITableViewは複数のセルを選択したときに複数の選択を可能にする
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell:UITableViewCell!
cell = tableView.dequeueReusableCell(withIdentifier: "language",for: indexPath)
cell?.textLabel?.text = languageValues[indexPath.row]
}
func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
if let cell = tableView.cellForRow(at: indexPath) {
cell.accessoryType = .none
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let cell = tableView.cellForRow(at: indexPath) {
cell.accessoryType = .checkmark
}