Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DeathscytheSeph

macrumors newbie
Original poster
Jul 9, 2007
27
0
Now I working on the iphone app and I have 2 question on the ui
1: how can i detect the press and hold on button like apple use on the icon to activate the arrange mode
2: how can i detect the drag and drop on the ui interface eg. i press the table view element and drag my finger on the button to do something other than just press on the table view element

any suggestion thank you^^
 
Well I think so, but can anyone give me some piece of code for both of that problem for me???

We're not here to write your app for you.

1. Start a timer on touch down to perform an action after n seconds, and invalidate it on touch up.
2. All the touches methods give you an set of touches to work with, just record the touch down position and calculate the delta in touches moved.
 
We're not here to write your app for you.

1. Start a timer on touch down to perform an action after n seconds, and invalidate it on touch up.
2. All the touches methods give you an set of touches to work with, just record the touch down position and calculate the delta in touches moved.

I know and sorry if i make you upset but I just curious that if I just hold the touch but not move the finger does the touchMove is invoked or not???
 
I know and sorry if i make you upset but I just curious that if I just hold the touch but not move the finger does the touchMove is invoked or not???

touchesMoved only calls when you move your finger. So if you just touch and don't move, then only touchesBegin is called. Start moving about an inch and like ten or so touchesMoved gets called. Then lift your finger up touchesEnded is called.

touchesMoved is actually called every few pixels you move and not just once if you move it once. So it's not touchesBegin, move an inch touchesMoved, touches Ended. It's more like touchesBegin, move an inch touchesMoved touchesMoved touchesMoved touchesMoved, touchesEnded.

Just so you know how it works ;)
 
touchesMoved only calls when you move your finger. So if you just touch and don't move, then only touchesBegin is called. Start moving about an inch and like ten or so touchesMoved gets called. Then lift your finger up touchesEnded is called.

touchesMoved is actually called every few pixels you move and not just once if you move it once. So it's not touchesBegin, move an inch touchesMoved, touches Ended. It's more like touchesBegin, move an inch touchesMoved touchesMoved touchesMoved touchesMoved, touchesEnded.

Just so you know how it works ;)

Thank you all of you :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.