I am writing a class that implements a keyboard for a piano. Right now it's just a UIView, and each key is a UIButton. I would like the user to be able to drag his finger and press a few keys, but now he only registers a touch. I added UIControlEventTouchDragEnter as a way to trigger a key event, but it only works if you press a key, drag your finger to another location and drag it back to the same key.
Is there a way to detect drag and drop events using UIButtons? Will I have to start and use something else for each key? I do not want to calculate which key is based on its coordinates, because it seems unnecessary. What do you think is the easiest way to do this?
Thank,
Luke
source
share