UIImageView* imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 300.0, 43.0, 43.0)];
[imageView setBackgroundColor:[UIColor clearColor]];
[imageView setImage:[UIImage imageNamed:@"test.png"]];
[self.view addSubview:imageView];
[UIView setAnimationRepeatAutoreverses:YES];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView animateWithDuration: 0.2f
delay: 0.0f
options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionBeginFromCurrentState
animations: ^(void){[imageView setFrame:CGRectMake(0.0, 350.0, 43.0, 43.0)];}
completion: nil];
UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(100, 0, 100, 30)];
[button setTitle:@"Button" forState:UIControlStateNormal];
[self.view addSubview:button];
UIImageView* imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 300.0, 43.0, 43.0)]; [imageView setBackgroundColor:[UIColor clearColor]]; [imageView setImage:[UIImage
Share
Try amending your animateWithDuration: see below
Within the options property I’ve added the value
UIViewAnimationOptionAllowUserInteraction