UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; [self.view addSubview:baseView]; baseView.backgroundColor = [UIColor blueColor]; baseView.center = self.view.center;
UIView *views = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; views.backgroundColor = [UIColor greenColor]; self.views = views; [baseView addSubview:views];
UIView *view_1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; view_1.backgroundColor = [UIColor yellowColor]; self.view_1 = view_1; }
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[UIView transitionFromView:self.views toView:self.view_1 duration:2 options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished) { }]; } |
UIView *views = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; views.backgroundColor = [UIColor greenColor]; self.views = views; [self.view addSubview:views]; views.center = self.view.center;
UIView *view_1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)]; view_1.backgroundColor = [UIColor yellowColor]; self.view_1 = view_1; }
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[UIView transitionWithView:self.views duration:3 options:UIViewAnimationOptionTransitionCurlUp animations:^{ [self.views addSubview:self.view_1]; } completion:^(BOOL finished) { }]; }
|