Ich bin für eine elegante Art und Weise zu durchlaufen ein Array zu durchlaufen undWie durch mehr UILabels
s jeden ihres Wertes zu einem oder mehreren der fünfUILabel
zuweisen
Dieser Code zeigt, was ich zu tun versuchen, (obwohl es sehr lange und sich wiederholende)
if touches.count >= 1 {
positionTouch1LBL.text = String(describing: touches[0].location(in: view))
} else {
positionTouch1LBL.text = "0.0/0.0"
}
if touches.count >= 2 {
positionTouch2LBL.text = String(describing: touches[1].location(in: view))
} else {
positionTouch2LBL.text = "0.0/0.0"
}
if touches.count >= 3 {
positionTouch3LBL.text = String(describing: touches[2].location(in: view))
} else {
positionTouch3LBL.text = "0.0/0.0"
}
if touches.count >= 4 {
positionTouch4LBL.text = String(describing: touches[3].location(in: view))
} else {
positionTouch4LBL.text = "0.0/0.0"
}
if touches.count >= 5 {
positionTouch5LBL.text = String(describing: touches[4].location(in: view))
} else {
positionTouch5LBL.text = "0.0/0.0"
}