Questions tagged [touchesended]

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

touchesEnded:withEvent: is a UIResponder event-handling method in the UIKit framework and MonoTouch.UIKit Namespace that is triggered when one or more fingers are removed from the screen.

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

Syntax Examples

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

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

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

Resources

Related Tags

31 questions
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
  • 171
  • 2
  • 9
2
votes
4 answers

UIWindow subclass: Touches event not get fired

I want to implement session time feature in my current project. So for that I am trying to subclass UIWindow and override the touchesBegan and touchesEnded methods. class BaseWindow: UIWindow { convenience init() { self.init(frame:…
Tapas Pal
  • 6,566
  • 6
  • 32
  • 76
2
votes
1 answer

SKScene touchesEnded not called when presenting the scene for the second time

I have a game with SpriteKit that have a main menu. The menu labels are triggered on touchesEnded. This works fine when starting the game for the first time. Then, after the first level ends, the main menu is presented again. This time, touchesEnded…
Tony
  • 576
  • 6
  • 13
1
vote
1 answer

iOS touchesMoved forwarded only once by UIButton

My goal, having at the same time, both: a UIButton that handle an event (.touchDown) another view upper in the hierarchy (i.e.: super) that receives a touchBegan/Moved/Ended/Cancelled. I want that event because, I need the touch force and other…
itMaxence
  • 736
  • 8
  • 20
1
vote
0 answers

Is there a way to make the WKWebview a firstResponder?

The Main idea is to reload the WKWebView if there is no touches or presses detected (i.e When webView remains inactive for some timeinterval ) . I tried the way to implement touchesBegan(_:with:) and touchesEnded(_:with:) I have overwritten those…
1
vote
0 answers

Is it possible to observe methods in Swift, or just properties?

I have an app where I'm attempting to add a sort of guided tour, where I lead the user from one feature to the next. What I want to do is to let the user interact with various interface elements and when they select the correct one the tour moves to…
mightknow
  • 256
  • 3
  • 13
1
vote
0 answers

Xcode touchesEnded stops working

I am writing an app with Xcode and swift. I am using SpriteKit's SKScene. I am having a super interesting error. I have a class Level1 and inside it, I have the touchesEnded method, and it works for about 2 or so clicks, and then it just stops. I…
1
vote
0 answers

iOS11 -touchesEnded method sometimes no longer called until view recreated

I have an App (since iOS6) with a self made gesture/tap detector using -touchesBegan and -touchesEnded methods. This detector worked flawlessly for years, but since recent iOS Versions the following happens occasionally: Sometimes at a random(?)…
cat
  • 2,721
  • 1
  • 21
  • 28
1
vote
2 answers

Get image name from touchesEnded

In my storyboard I have a few images that are "User Interaction Enabled". In the UIViewController I override the touchesEnded function. override func touchesEnded(_ touches: Set, with event: UIEvent?) { super.touchesEnded(touches,…
Daniel Åsberg
  • 175
  • 1
  • 1
  • 6
1
vote
1 answer

How to know when the button is pressed and canceled Button pressing

I made a button. And used the below code. But it doesn't work at all. override func pressesBegan(_ presses: Set, with event: UIPressesEvent?) { print("pressTest") btnConvert.isHidden = true } How can I know when the button is…
김동현
  • 81
  • 3
  • 12
1
vote
1 answer

how to use touchesBegan and touchesEnded?

I added below codes on ViewController override func touchesBegan(_ touches: Set, with event: UIEvent?) { print("started") } override func touchesEnded(_ touches: Set, with event: UIEvent?) { print("ended") } but it…
김동현
  • 81
  • 3
  • 12
1
vote
1 answer

Getting a vector from a touch location in swift 3

As the title says, how can I accomplish this? I can get the first touch but I don't know how to get the last touch if it is a swiping gesture. With the following code I get the error: value of type 'Set' has no member 'last'. Not really sure how to…
Lyres
  • 193
  • 1
  • 13
1
vote
1 answer

Touchesmoved - updating multiple elements on single drag

I'm trying to update multiple images upon clicking and dragging over the elements. I've implemented touchesbegan, touchesmoved, and touchesended, but I don't know how to make touchesmoved effect multiple images. I've been scouring the web, but I…
Apocal
  • 162
  • 11
1
vote
1 answer

How to access objects of SKSpriteNode subclass when moving them (Swift)

I am confused with the objects of my class Card that is the subclass of SKSpriteNode. How do I get access to these objects when a user move them. So far I can only access SKNode objects overriding touchesEnded function. override func…
David_Zizu
  • 569
  • 1
  • 5
  • 14
1
vote
2 answers

When does a iOS touches method (Cancelled & Ended) called?

I'm trying to write a program using UIBezierPath and touches Methods. I am confused by two touches method: - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesEnded:(NSSet *)touches…
31i45
  • 195
  • 1
  • 1
  • 12
1
2 3