- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];// 某一个手指
CGPoint currentPoint = [touch locationInView:self.superview]; // 自己相对于父视图的坐标
CGPoint previousPoint = [touch previousLocationInView:self.superview];
CGFloat dltX = currentPoint.x - previousPoint.x;
CGFloat dltY = currentPoint.y - previousPoint.y;
CGPoint center = self.center;
CGPoint newCenter = CGPointMake(center.x + dltX, center.y + dltY);
self.center = newCenter;
self.backgroundColor = [UIColorcolorWithRed:(arc4random() % 256)/255.0green:(arc4random() % 256)/255.0blue:(arc4random() % 256)/255.0alpha:1.0];
}