Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-24-2011, 10:35 AM   #1 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Smile How to get touch location on button action (TouchUpInside, TouchDragInside)

I'm back! I took a long break from iOS development because of school and actually this is the last day of my spring break so I'll be taking another short break after this.

Anyways, I have a view covering the bottom quarter of a view, that I want to slide up. I've tried using touchesMoved and getting the location and updating the center of the covering view but touchesMoved, touchesBegan and all that seem not to work. So now I put a UIControl over the view for when its covering the bottom quarter. My plan is that when you TouchDragInside the UIControl, it updates the center of the covering view and the UIControl. After the UIControl's center passes self.view.center, the covering view goes all the way to the top (completely covering) and the UIControl is removed.

Code:
- (IBAction)bottomViewControlTouchDragInside:(id)sender {
    //How do I get the location of the touch when a action is received from a button?
}
UnretroGamer is offline   Reply With Quote
Old 04-24-2011, 11:21 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

to retrieve location of a tap you need to use UIGestureRecognizer

or try as explained here
http://www.iphonedevsdk.com/forum/ip...ap-button.html
__________________

Last edited by dany_dev; 04-24-2011 at 11:24 AM.
dany_dev is offline   Reply With Quote
Old 04-24-2011, 01:26 PM   #3 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
to retrieve location of a tap you need to use UIGestureRecognizer

or try as explained here
http://www.iphonedevsdk.com/forum/ip...ap-button.html
Thanks for the reply, I considered that but I need to get the touch location every time UIControl sends TouchDragInside. So that I can move the entire view with the touch. Updating the location according to the touch location everytime there is a TouchDragInside. Not just for one tap. :/

I want to know the touch's location everytime the TouchDragInside message is sent.
UnretroGamer is offline   Reply With Quote
Old 04-24-2011, 01:28 PM   #4 (permalink)
Just Some Guy
 
Join Date: Dec 2010
Posts: 112
UnretroGamer is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
to retrieve location of a tap you need to use UIGestureRecognizer

or try as explained here
http://www.iphonedevsdk.com/forum/ip...ap-button.html
I just saw the UIPanGestureRecognizer in the link you gave me. Could that work? I'm gonna try it out.
UnretroGamer is offline   Reply With Quote
Reply

Bookmarks

Tags
action, button, location, touch, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 343
11 members and 332 guests
dansparrow, iOS.Lover, lorrettaui53, Nobbsy, oztemel, pbart, PlutoPrime, samdanielblr, sledzeppelin, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:51 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0