あなたが与えたリンクの例にコードが表示されます
- (float)extractSize:(UIPanGestureRecognizer *)panGestureRecognizer
{
// 1
float vel = ccpLength([panGestureRecognizer velocityInView:panGestureRecognizer.view]);
float size = vel / 166.0f;
size = clampf(size, 1, 40);
// 2
if ([velocities count] > 1) {
size = size * 0.2f + [[velocities objectAtIndex:[velocities count] - 1] floatValue] * 0.8f;
}
[velocities addObject:[NSNumber numberWithFloat:size]];
return size;
}
試してみませんか?それを...に置き換えます
- (float)extractSize:(UIPanGestureRecognizer *)panGestureRecognizer
{
// 1
float vel = ccpLength([panGestureRecognizer velocityInView:panGestureRecognizer.view]);
float size = vel / 166.0f;
size = clampf(size, 1, 40);
// 2
if ([velocities count] > 1) {
size = size * 1.2f + [[velocities objectAtIndex:[velocities count] - 1] floatValue] * 0.8f;
}
[velocities addObject:[NSNumber numberWithFloat:size]];
return size;
}
編集:とにかく、このメソッドで遊ぶと、必要なものが得られるはずです。