touchesmoved

touchesMoved called at irregular intervals

我只是一个虾纸丫 提交于 2019-12-23 10:40:40
问题 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 all stuttery for about 10-30 seconds . Then, it goes back to moving silky-smooth. Visually, it looks like the game's frame rate dropped to 15 fps for a while, but in actual fact it's running at rock-solid 60 fps all the time. However, I noticed that

Passing swipe touches from UIView to underlying UIScrollView for proper scrolling

梦想与她 提交于 2019-12-22 05:35:18
问题 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) . .UIScrollView (ScrollView: 320x460) . .UIView (OverlayView: 320x40) . . . .UIButton (ArbitraryButton1) . . . .UILabel (ArbitraryLabel1) . . . .UILabel (ArbitraryLabel2) The goal here is for the OverlayView to serve as a unified, transparent

Stretchy UIBezierPath line?

旧时模样 提交于 2019-12-21 02:54:39
问题 I want to draw a straight line with my finger that automatically sizes based upon how far away I am from the point of origin. So if I touch the screen in the middle and slide my finger out a line appears to 'stretch' and pivot around the point of orgin as my finger moves on the screen. WHhen I lift my finger. The Destination Point should finalize and create a line. I can drag my finger across the screen and 'Draw' on the screen but that's not what I am wanting to do. I thought UIBeizerPath

Make a UIView draggable with the finger

蓝咒 提交于 2019-12-21 01:15:06
问题 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 example of point, I suppose I can drag for any point of the "small" UIView. I tried using UITapGestureRecognizer but it didn't worked as my code was not good enough and I could not made it draggable because it's only the tap, not tap and move. I hope

iOS - Detecting touches in a UIView?

人盡茶涼 提交于 2019-12-19 06:01:44
问题 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 called. Any solution to detect moving touches that have not started in the current view? @implementation MycustomView - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // This only gets called if touches have started in the current

In Swift, how can I check that a user is no longer touching the screen after touchesMoved is triggered?

筅森魡賤 提交于 2019-12-13 18:36:58
问题 I need to know that a user started to touch the screen and then know when he is not touching it anymore. With touchesBegan and touchesEnded I can get such information. However, if the user is swiping his fingers, then I know he started doing it with touchesMoved . However I am not able to check when he is no longer touching the screen. Basically , touchesEnded will not fire after the user stopped swipping. Any ideas? Example of my code: override func touchesBegan(touches: Set<UITouch>,

touchesMoved not firing in iOS5 for the iPhone for UIScrollView

爷,独闯天下 提交于 2019-12-13 15:54:41
问题 I have an iPhone app with a ScrollView which needs to respond to touch events. In order to support touch events in the scrollview I needed to base it off a custom class which captured the touch events and passed them to the main view. It works as expected when run in the 4.3 iPhone simulator. With the NSLOG entries I get output like this: 2011-10-17 09:28:06.782 SingleView[7000:b303] gameTable began 2011-10-17 09:28:06.784 SingleView[7000:b303] outside began 2011-10-17 09:28:09.976 SingleView

What is the smoothest audio API for looping iPhone sounds

浪子不回头ぞ 提交于 2019-12-13 08:39:26
问题 I am trying to loop a 2 second sound continuously that I am using in my touchesMoved method and want to make it play continuosly and not stutter or stop because the user stopped moving their finger and also maybe fade the sound into itself smoothly. I have tried system sounds and AVAudioPlayer 回答1: i've alreay offered you to use OpenAL in your previous question 来源: https://stackoverflow.com/questions/1938274/what-is-the-smoothest-audio-api-for-looping-iphone-sounds

Creating a draggable image view

泪湿孤枕 提交于 2019-12-12 01:28:48
问题 I have been searching the net for a long time and I have not found a concrete way of making an image view draggable. Here is what I have so far: tempViewController.h #import <UIKit/UIKit.h> #import "MyRect.h" @class UIView; @interface tempViewController : UIViewController @property (nonatomic, strong) MyRect *rect1; @end tempViewController.m #import "tempViewController.h" @interface tempViewController () @end @implementation tempViewController @synthesize rect1 = _rect1; - (void)viewDidLoad {

TouchesMoved with UIButton xcode 4.4 iOS 5.1.1

淺唱寂寞╮ 提交于 2019-12-11 02:59:30
问题 I know this question seems to be already asked and answered but I can't resolve my issue. I want to move the objects of my view to follow horizontal slides of a finger (going to previous or next page) For this, I use TouchesBegan, TouchesMoved and TouchesEnded methods. It works fine when the touches began on the view background but does not work when touches began on uibuttons. To solve the problem, I have subclassed the uibuttons which i want to allow the gesture and it was working fine when