• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UIButton and UIView touch handling issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UIButton and UIView touch handling issues


  • Subject: UIButton and UIView touch handling issues
  • From: Miles <email@hidden>
  • Date: Mon, 25 May 2009 11:53:53 -0700

I'm trying to create something similar to a piano where there are keys next
to each other that should respond when a touch is dragged across them.

I have it working with an outter controller that does a hittest on all it's
children to find the key that is hit, but I'm trying to see if I can avoid
that by detecting the touches and drag directly in the individual
controllers for each key.

I have a button in each of these views but the problems are:

1) The button hit area is much larger than the button itself, so
UIControlEventTouchDragExit doesn't get called until the touch is far
outside of the actual button graphic.
2) UIControlEventTouchDragEnter doesn't ever get called unless I touch down
on a button, out of it, and back in. In other words if I touch down on one
button and drag over another, the UIControlEventTouchDragEnter doesn't get
called on the button i just dragged into.

I also tried detecting the touches in the view controller using
touchesBegan, etc and programatically set the button as highlighted so that
it appears selected, but then I can't detect when the touch has exited the
view on a drag.

Any ideas on the best way to do this?
Thanks!
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Underlining a Tab item label
  • Next by Date: Re: what is the easy way to update all bound controls
  • Previous by thread: Re: Underlining a Tab item label
  • Next by thread: Removing delay for a menu in NSSegmentedControl?
  • Index(es):
    • Date
    • Thread