- (void)shake
{
__block UIImageView* imageViewUp = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cover_4.jpg"]];
imageViewUp.frame = CGRectMake(0.0f, -(self.view.bounds.size.height/2), self.view.bounds.size.width, self.view.bounds.size.height/2);
[self.view addSubview:imageViewUp];
__block UIImageView* imageViewDown = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cover_4.jpg"]];
imageViewDown.transform = CGAffineTransformMakeRotation(M_PI);
imageViewDown.frame = CGRectMake(0.0f, self.view.bounds.size.height, self.view.bounds.size.width, self.view.bounds.size.height/2);
[self.view addSubview:imageViewDown];
[UIView animateWithDuration:0.8
animations:^{
imageViewUp.frame = CGRectMake(0.0f,0.0f, self.view.bounds.size.width, self.view.bounds.size.height/2);
imageViewDown.frame = CGRectMake(0.0f, self.view.bounds.size.height/2, self.view.bounds.size.width, self.view.bounds.size.height/2);
}
completion:^(BOOL finished){
[UIView animateWithDuration:0.8 delay:0.2 options:0 animations:^{
imageViewUp.frame = CGRectMake(0.0f, -(self.view.bounds.size.height/2), self.view.bounds.size.width, self.view.bounds.size.height/2);
imageViewDown.frame = CGRectMake(0.0f, self.view.bounds.size.height, self.view.bounds.size.width, self.view.bounds.size.height/2);
}
completion:^(BOOL finished){
[imageViewUp removeFromSuperview];
[imageViewUp release];
[imageViewDown removeFromSuperview];
[imageViewDown release];
}];
}];
}