下面的写法是错误的:
CGFloat x = self.contentView.frame.origin.x;
x = _lastDownX + translation.x;
self.contentView.frame.origin.x = x;
正确的写法是:
CGRect frame = self.contentView.frame;
frame.origin.x = _lastDownX + translation.x;
self.contentView.frame = frame;