Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectable Custom TransitionStyle for in and out #29

Open
mehmetcirak opened this issue Aug 13, 2014 · 3 comments
Open

Selectable Custom TransitionStyle for in and out #29

mehmetcirak opened this issue Aug 13, 2014 · 3 comments

Comments

@mehmetcirak
Copy link

Can i select my TransitionStyle for in and out animation.
Or define in the BKTPopinTransitionStyleCustom block
for example:

    [popin setPopinCustomInAnimation:^(UIViewController *popinController, CGRect initialFrame, CGRect finalFrame) {

        [popin setPopinTransitionStyle:BKTPopinTransitionStyleSnap];

    }];

    [popin setPopinCustomOutAnimation:^(UIViewController *popinController, CGRect initialFrame, CGRect finalFrame) {

        [popin setPopinTransitionStyle:BKTPopinTransitionStyleSlide];

    }];
@sparga
Copy link
Collaborator

sparga commented Aug 14, 2014

Transitions style are symmetric. But if you really need a different style for out animation, you can change the popinTransitionStylein the completion block called after popin presentation.
It would give something like that :

[self.navigationController presentPopinController:popin animated:YES completion:^{
        //Code to run on completion
        //Change transition style
        [popin setPopinTransitionStyle:BKTPopinTransitionStyleSlide];
}];

@sparga sparga closed this as completed Aug 14, 2014
@mehmetcirak
Copy link
Author

Thanks for help.But this not worked me when I'm clicked fastly.if i wait 2-3 second is working.Can i lock transition ,completion block is working..
My code is :

PopInViewController *popin = [[PopInViewController alloc]init];

BKTBlurParameters *blurParameters = [BKTBlurParameters new];
blurParameters.alpha = 1.0f;
blurParameters.radius = 8.0f;
blurParameters.saturationDeltaFactor = 1.8f;
blurParameters.tintColor = [UIColor colorWithRed:0.150 green:0.150 blue:0.035 alpha:0.2];
[popin setBlurParameters:blurParameters];
[popin setPopinOptions:[popin popinOptions]|BKTPopinBlurryDimmingView|BKTPopinDisableAutoDismiss];

[popin setPopinTransitionStyle:BKTPopinTransitionStyleSnap];
[popin setPopinTransitionDirection:BKTPopinTransitionDirectionTop];

[self presentPopinController:popin animated:YES completion:^{

    [popin setPopinOptions:BKTPopinDefault];
    [popin setPopinTransitionStyle:BKTPopinTransitionStyleSlide];
    [popin setPopinTransitionDirection:BKTPopinTransitionDirectionBottom];

}];

what is wrong.

@sparga
Copy link
Collaborator

sparga commented Aug 18, 2014

Your code looks correct. But I think what you mean. When you click before the animation is over, the dismiss is not working as expected. And the snap transition is the longest, so it is really obvious with this one.
One way to prevent that would be disabling user interaction on popin during transitions.

@sparga sparga reopened this Aug 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants