UIView movement
Which is the best way to move a UIView. I have a custom UIView with some custom things in it, like shadows, labels etc.
Today I'm using, for move this UIView.:
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touc开发者_Python百科h = [[event allTouches] anyObject];
if (self.isEditing) {
CGPoint location = [touch locationInView:[rootView view]];
self.center = location;
}
}
Is this the best way to move a UIView? I experience this a bit laggy.
I usually reposition a view using the offset between the touchesBegan location and the touchesMoves location.
精彩评论