Skip to content

Flip transition, think iTunes App Store artwork flip to details.

License

Notifications You must be signed in to change notification settings

cbess/CBFlipViewTransition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CBFlipViewTransition

Flip transition, think iTunes App Store artwork flip to details.

- (IBAction)flipButtonPressed:(id)sender {
    self.flipViewTransition = [CBFlipViewTransition new];
    
    if (!_flipped) {
        self.flipViewTransition.frontView = self.oneImageView;
        self.flipViewTransition.backView = self.twoImageView;
    } else {
        self.flipViewTransition.frontView = self.twoImageView;
        self.flipViewTransition.backView = self.oneImageView;
    }
    self.flipViewTransition.containerView = self.view;
    self.flipViewTransition.zDistance = 700;
    self.flipViewTransition.endingCenter = (_flipped ? self.oneImageView.center : self.twoImageView.center);
    self.flipViewTransition.flipDirection = (_flipped ? CBFlipDirectionLeft : CBFlipDirectionRight);
    self.flipViewTransition.duration = 1.5f;
    
    __typeof__(self) __weak weakSelf = self;
    [self.flipViewTransition performTransitionWithCompletion:^{
        weakSelf.flipViewTransition.frontView.hidden = YES;
        
        _flipped = !_flipped;
    }];
}

About

Flip transition, think iTunes App Store artwork flip to details.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published