Etiqueta arrastável - ios
Eu tenho um requisito para mover um rótulo apenas quando o usuário toca nele e arrasta. Não consigo descobrir se o usuário tocou nesse rótulo ou não. Eu usei o método touchesMoved (Swift 2). Abaixo está o meu código
override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
super.touchesBegan(touches as Set<UITouch>, withEvent: event)
let touch = touches.first
if (touch!.view) == (moveLabel as UIView) // moveButton is my label
{
location = touch!.locationInView(self.view)
moveLabel.center = location
}
}
Quando faço isso, meu rótulo não está se movendo :( alguém me ajude por favor