#import "ViewController.h"

@interface ViewController ()
@property (strong, nonatomic) IBOutlet UIImageView *imageViewFirst;
@property (strong, nonatomic) IBOutlet UIImageView *imageViewSecond;
@property(nonatomic,assign)__block BOOL rectToVisible;
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    _rectToVisible=YES;
    [self.view addSubview:_imageViewFirst];
    
    
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (_rectToVisible) {
        
        [UIView transitionFromView:self.imageViewFirst toView:self.imageViewSecond duration:1 options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished) {
            
            NSLog(@"animatioin complete");
            _rectToVisible=!_rectToVisible;
            
        }];
    }
    else
    {
        [UIView transitionFromView:self.imageViewSecond toView:self.imageViewFirst duration:1 options:UIViewAnimationOptionTransitionFlipFromRight completion:^(BOOL finished) {
            
            NSLog(@"animatioin complete");
            _rectToVisible=!_rectToVisible;
            
        }];
    }
 
}



@end

 

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-06-06
  • 2021-10-15
猜你喜欢
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-08-29
相关资源
相似解决方案