我想用随机时长和随机延迟来动画我的图像。请帮帮我。我是初学者。这里是代码:UIView动画随机
-(void)up
{
[UIView animateWithDuration:0.3 animations:^{
mole.center = CGPointMake(63, 210);
}];
[self performSelector:@selector(down) withObject:nil afterDelay:1.0];
}
所以,我需要“0.3”,从持续时间和1.0的延迟是随机的。比如在0.0到1.0之间。谢谢。
'arc4random()'。 – Kevin