iOS 7 GUI update lag during drag touches
iOS 7 GUI update lag during drag touches
- Subject: iOS 7 GUI update lag during drag touches
- From: Carl Hoefs <email@hidden>
- Date: Thu, 03 Oct 2013 12:47:50 -0700
iOS 6.1.3 & 7.0.2, newb!
I'm seeing an unacceptable lag in my iOS app on drag touches, from when a finger is dragged across the screen to when my code updates the screen. I can't figure out what is causing the lag.
Here's my setup. I have a -touchesBegan:withEvent: method in my view controller that gets invoked via callback from the GUI when a finger touch occurs. My code displays a tiny dot on the GUI beneath the user's fingertip that is supposed to track with the user's touch in real time.
-(void) -touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint apoint=[[touches anyObject] locationInView:[self view]];
[layer setPosition:apoint];
}
The 'layer' variable is defined as:
CALayer *layer=[[CALayer alloc]init];
[layer setDelegate:self];
[layer setBounds:CGRectMake(0,0,5,5)]; // a tiny "dot"
This all works well except when the user makes large, sweeping touches (say dragging a fingertip across the entire screen). In this case, the update drawing of the dot lags a second or two behind, which is unacceptable.
So I'm wondering how to handle this. FWIW, adding a [super touchesBegan:touches withEvent:event] to the above callback method didn't change the behavior.
- Carl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden