Vorlesungen
  Download     DBS     Sprachen     Oberflächen     File Formats     Impressum     Datenschutz  
1. Sem
2. Sem
3. Sem
4. Sem
5. Sem
iOS
Android und JetPack
Wahlpflicht-SoSe
Wahlpflicht-WiSe
Projektwochen
Allgemein:
Startseite
Vorlesungen
Labore
Sinnvolle Programme
Lineare Regression
GUI-Entwurfsarbeit
Single-Format
Design Pattern-Termine
Observer1
Bsp2
Json-Array
Json-Dialogelemente
Webtechnologien

uiTableView mit Edit prepare

TableView prepare-Methode

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let button:UIButton = sender as? UIButton {
// Abfrage, welcher Schalter: Übergabe der Stadt
if button==bnedit {
if let indexPath = tableview.indexPathForSelectedRow {
let city:City = cities[indexPath.row]
if let dest = segue.destination as? InputViewController {
dest.city=city
}
}
} // edit
} // if
} // prepare


// Rücksprung vom ChangeViewController Abbruch
@IBAction func unwindCancel(_ segue:UIStoryboardSegue) {
// keine Aktion notwendig
} // unwindToEditViewCancel

// Rücksprung vom ChangeViewController Save
@IBAction func unwindOk(_ segue:UIStoryboardSegue) {
if let src = segue.source as? InputViewController {
if let indexPath = tableview.indexPathForSelectedRow {
let citytable:City = cities[indexPath.row]
citytable.initCity(city)
tableview.reloadRows(at: [indexPath], with: UITableView.RowAnimation.right)
}

} // unwindOk


Klassen für TableView
Format a number to a string