Questions tagged [touchesmoved]

Use this tag for questions related to touchesMoved:withEvent, a UIResponder event-handling method in the UIKit framework and MonoTouch.UIKit Namespace.

touchesMoved:withEvent: is a UIResponder event-handling method in the UIKit framework and MonoTouch.UIKit Namespace that is triggered when one or more fingers moves on the screen.

Along with touchesBegan:withEvent:, touchesCancelled:withEvent:, and touchesEnded:withEvent:, it is one of the primary touch event-handling methods.

Syntax Examples

func touchesMoved(_ touches: Set<UITouch>,
     withEvent event: UIEvent?)

- (void)touchesMoved:(NSSet<UITouch *> *)touches
        withEvent:(UIEvent *)event

[MonoTouch.Foundation.Export("touchesMoved:withEvent:")]
public virtual Void TouchesMoved (NSSet touches, UIEvent evt)

Resources

Related Tags

246 questions
4
votes
1 answer

How to cancel uitouches?

In my app I want to have the users tap on the left side of the screen to increase their speed and swipe on the right side to work a joystick. However, if the user keeps holding the left side, the joystick doesn't work right. I am using…
Greg
  • 1,296
  • 2
  • 11
  • 26
4
votes
1 answer

Set center point of UIView after CGAffineTransformMakeRotation

I have a UIView that I want the user to be able to drag around the screen. -(void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { CGPoint pt = [[touches anyObject] locationInView:self]; CGPoint center = self.center; CGFloat…
Dave
  • 107
  • 2
  • 4
4
votes
0 answers

Touch events not sent to a new view added with addSubview

I have an area of my screen on which I want to recognize a long press. I use a UILongPressGestureRecognizer. Once the long press event happens, I show a custom UIView that has a touchesMoved method, by adding it as a subview. This custom UIView is…
rafalio
  • 3,928
  • 4
  • 30
  • 33
4
votes
1 answer

Touch controls working for iOS 7,6,5... but not for iOS 8

I developed a OpenGL ES game several years ago and works well until now: I have downloaded Xcode 6 and iOS 8 in my iPad 3, and touch control (touchesBegan, touchesMoved, touchesEnded) only detect a square of 768x768 points, instead of 1024x768. A…
Marc
  • 61
  • 1
4
votes
1 answer

iOS: How do paint/draw apps eliminate the initial delay in response to touches?

When I've used painting/drawing apps, I never notice a delay between pressing my finger and being able to see something drawn on the display. However with my app, the initial touches are received very slowly. The second and third and fourth gestures…
user1312991
3
votes
3 answers

iPad Landscape messing up touches began

My app is only allowable in the landscape orientations, and it launches in landscape. Thus, the top left corner when the iPad is landscape is (0,0), so everything works fine. However, when I pick up "touchesBegan"...it isn't working properly. Only…
CodeGuy
  • 28,427
  • 76
  • 200
  • 317
3
votes
2 answers

Free hand drawing on UIView not UIImageView

How to draw a freehand drawing on UIView rather than UIImageView using touches moved method. I have many other subviews on this view so i cannot add image view as whole view.I have seen many examples but they are drawing in UIImageView.
Prerna chavan
  • 3,179
  • 7
  • 35
  • 77
3
votes
1 answer

touchesMoved out of the self view

I'm working on an important project at my job place, and having a problem which I'm stack with: I have 2 views in a line (1 scroll view with images, and the other is just a UIImageView), I would like to make it able to move an image from the scroll…
Issa
  • 139
  • 4
  • 13
3
votes
2 answers

In subclassed UIImageView, touchesBegan fires, touchesMoved fires a couple times, but then stops for no reason

I have subclassed a UIImageView, and have implemented touchesBegan/Moved/Finished like this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"Began"); mouseSwiped = NO; UITouch *touch = [touches anyObject]; if ([touch…
Stephen J.
  • 3,127
  • 4
  • 20
  • 28
3
votes
3 answers

detecting the [UITouch view] in touchesMoved method

I wish to drag from one subview to another within my application (and connect them with a line), and so I need to keep track of the current view being touched by the user. I thought that I could achieve this by simply calling [UITouch view] in the…
Matt Carr
  • 413
  • 5
  • 15
3
votes
1 answer

[IOS SDK]- touchesBegan with specific object?

When I touch anywhere on screen touchesBegan event triggered. but I couldn't manage how if I touch specific object as like UIImageView? -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches]…
modusCell
  • 13,151
  • 9
  • 53
  • 80
3
votes
1 answer

How to move an SKSpriteNode along a horizontal line

I have an SKSpriteNode that can be moved anywhere I am touching, and I want it to move where my finger is, just along a horizontal line so that is cannot move vertically. class GameScene: SKScene { var ship = SKSpriteNode() override func…
Nate N.
  • 35
  • 2
3
votes
0 answers

tvOS touchesBegan, touchesMoved, touchesEnded

I am confused on how touches trickle upwards to parent views. To test I built a simple program that has 4 UIButtons. The Button class sends the touch events upwards: import UIKit class ViewController: UIViewController { override func…
Jim
  • 181
  • 2
  • 9
3
votes
1 answer

Increase frequency calls of touchesMoved

Is there a way to increase the frequency calls of touchesMoved than the default? I need more calls of it to draw a smooth circle. It gets called not too frequent by default and so I get an edgy circle. Is there a way to tweek the frequency of…
Sharief
  • 1,487
  • 2
  • 18
  • 26
3
votes
2 answers

How to detect touchesBegan, touchesMoved, touchesEnded events from another class

I need to use touch events but i am trying to detect it from another class, so i will call back to my main class if touched or moved etc. I am calling init method in "classTouchEvents" firstly from my main class like…
Yucel Bayram
  • 1,653
  • 2
  • 22
  • 41
1
2
3
16 17