I can move a single UIView
using the code below but how do I move multiple UIView
's individually using IBOutletCollection
and tag
values?
class TeamSelection: UIViewController {
var location = CGPoint(x: 0, y: 0)
@IBOutlet weak var ViewTest: UIView! // move a single image
@IBOutlet var Player: [UIView]! // collection to enable different images with only one outlet
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
let touch: UITouch = touches.first! as UITouch
location = touch.location(in: self.view)
ViewTest.center = location
}
}