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
22
votes
12 answers

How to cancel a sequence of UITouch events?

I have a UIImage view that responds to touch events. I want to cancel the touch sequence, i.e., further calls to touchesMoved:, if the touch goes outside of certain bounds. How can I do that? I know that in touchesMoved: I can inspect the…
subjective-c
  • 1,833
  • 9
  • 25
  • 35
10
votes
2 answers

Scrolling in a UIScrollView without triggering touchesCancelled

Overview I'm working on an iPhone game whose code I inherited from another developer. The gaming grid is a UIScrollView having a contentSize of 1000x1000. The grid contains several elements drawn on the screen via OpenGL's Texture2D class. The…
purefusion
  • 943
  • 1
  • 15
  • 23
9
votes
4 answers

iOS - Detecting touches in a UIView?

So I have a Subclass of UIView that is suppose to detect touches. The view detect touches only if the touches started inside the current view. When the touches start outside of the view and they move inside my custom view touchesMoved doesn't get…
aryaxt
  • 76,198
  • 92
  • 293
  • 442
9
votes
3 answers

Touch event handled by multiple views

I have a subclass of UIView on top of a UITableView. I am using the UITableView to display some data and, at the same time, I would like to overlay an animation that follows the finger (for instance, leaving a trail). If I get it right, I need the…
ios-lizard
  • 834
  • 1
  • 12
  • 19
9
votes
1 answer

Swift: Agar.io-like smooth SKCameraNode movement?

If anyone here has played Agar.io before, you'll probably be familiar with the way the camera moves. It slides toward your mouse depending on the distance your mouse is from the center of the screen. I'm trying to recreate this movement using an…
MysteryPancake
  • 1,365
  • 1
  • 18
  • 47
8
votes
1 answer

touchesMoved being called on single Tap with iPhone 6s and onwards

I have a custom UIButton and I have implemented touches delegates in custom button class. Every thing is working fine up until iPhone 6 Plus. All of the devices above it like iPhone 6s and 7 are creating a problem. When I single tap a button…
Hassy
  • 5,068
  • 5
  • 38
  • 63
8
votes
1 answer

draw a line in sprite kit in touchesmoved

I would like to draw a line in sprite kit along the points collected in touchesmoved. Whats the most efficient way of doing this? I've tried a few times and my line is either wrong on the y axis, or takes up a lot of processing power that the fps…
dev6546
  • 1,412
  • 7
  • 21
  • 40
8
votes
4 answers

Make a UIView draggable with the finger

I have the mainViewController but I have an small UIView inside that is activated when you tap a MKAnnotationView in the MKMapKit, so I need that UIView to be draggable in any part of the screen. An example screenshot of my app: The circle is an…
Alejandro L.
  • 1,066
  • 5
  • 17
  • 38
7
votes
2 answers

TouchesMoved() lagging very inconsistently when there is a SkSpriteNode with a physics body

I'm using Swift 3.0, SpriteKit, and Xcode 8.2.1, testing on an iPhone 6s running iOS 10.2. The problem is simple... on the surface. Basically my TouchesMoved() updates at a very inconsistent rate and is destroying a fundamental part of the UI in my…
Marshall D
  • 454
  • 3
  • 20
7
votes
3 answers

UIScrollView - tell the difference between setContentOffset and manual scrolling

I have a scrollview, which automatically advances every 3 seconds to the next "page" (page control also used). However, once the user touches the scrollview, I want to stop the auto-advancing. I have subclassed the scrollview. I can detect…
soleil
  • 12,133
  • 33
  • 112
  • 183
7
votes
2 answers

iOS: Transfer ownership of UIView while touches happening?

The moment I receive touchesBegan, I want to removeFromSuperview the view that was touched and addSuperview to a new parent view, and then continue to receive touches. However I am finding that sometimes this does not work. Specifically,…
user945620
6
votes
3 answers

Passing swipe touches from UIView to underlying UIScrollView for proper scrolling

I have a situation similar to these two posts (1907297 AND 689684) and to describe my situation most concisely, I present this text/graphical layout (similar to what you'd see in IB, dots used to enforce indent levels) UIView (MainView: 320x460) .…
MobileJoel
  • 61
  • 1
  • 2
5
votes
1 answer

Impact of using LLVM-GCC to resolve issues on 2nd generation device running iOS 4.2.1

I have an app that uses touch events to draw on the screen. I use UITouch locationInView to return the CGPoint of the touch. The problem is that the x and y coordinates are always the same — BUT only on 2nd generation devices running iOS 4.2.1 AND…
jenonen
  • 573
  • 1
  • 5
  • 8
5
votes
1 answer

Swift Sprite Kit Began Touch Function

Im messing around with an xcode project and I am trying to make a red ball SKShapeNode move around when I touch it. My own source code in the touch began class is not doing the trick. What is the flaw with my code and what do I need to do in order…
Cj Miller
  • 51
  • 1
  • 7
5
votes
6 answers

touchesMoved called at irregular intervals

I'm making a game for iOS where you mostly drag big objects across the screen. When I run the game on an actual iPad/iPhone for a while (continuously dragging the object in circles across the screen) every 5 minutes or so the dragged object goes…
1
2 3
16 17