// Override to support rearranging the table view.
func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) {
let elementToMove = ordersArray[fromIndexPath.row]
ordersArray.remove(at: fromIndexPath.row)
ordersArray.insert(elementToMove, at: to.row)
}
func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
return .none
}
func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool {
return false
}
// Override to support conditional rearranging of the table view.
func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
// called when about to proceed segue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// if the ID is "ToDetailViewController" -> create a constant *destination that stores a destionController / DetailViewController
if segue.identifier == "TodetailOrderVC", let destination = segue.destination as? detailOrderVC {
// accessing a presssed cell and getting indexPath of the pressed cell
if let cell = sender as? UITableViewCell, let indexPath = tableView.indexPath(for: cell) {
//let arr = ordersArray[indexPath.row]
destination.allAboutOrders = someorder_id[indexPath.row]
destination.allAboutOrdersid = someid[indexPath.row]
destination.allAboutOrdersStatus = somestatus[indexPath.row]
destination.allAboutOrdersDate1 = somedate1[indexPath.row]
destination.allAboutOrdersDate2 = somedate2[indexPath.row]
//Мутка без пробельщина
let contacts = someContacs[indexPath.row]
let telBezProbel = contacts.replacingOccurrences(of: " ", with: "")
destination.allAboutTargetContacs = telBezProbel
destination.allAboutPriceclient = somePriceclient[indexPath.row]
destination.allAboutTargetname = someTargetname[indexPath.row]
destination.allAboutAdmnotes = someAdmnotes[indexPath.row]
destination.allAboutTargetnotes = someTargetnotes[indexPath.row]
destination.allAboutAddr = someAddr[indexPath.row]
//print("someContacs=\(telBezProbel)")
destination.allAboutChekCard = someCheckCard[indexPath.row]
}
}
}
Как запилить чекбокс и запихать его в массив
далее я хочу передать это дело в post запрос