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

Broken hide animation!!! #1719

Open
revolter opened this issue Apr 13, 2017 · 1 comment
Open

Broken hide animation!!! #1719

revolter opened this issue Apr 13, 2017 · 1 comment

Comments

@revolter
Copy link
Contributor

Previously, I had this code:

- (void)setView:(UIView *)view hiddenAtEndOfAnimation:(BOOL)hidden atPage:(Page)page {

	IFTTTHideAnimation *hideAnimation = [[IFTTTHideAnimation alloc] initWithView:view];

	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.left andHidden:!hidden]];
	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.right - 1 andHidden:!hidden]];

	[hideAnimation addKeyFrame:[[IFTTTAnimationKeyFrame alloc] initWithTime:page.right andHidden:hidden]];

	[self.contentAnimator addAnimation:hideAnimation];
}

but with the latest version, this is impossible, as there is no simple init that only sets the view. Highly dissapointed.

@revolter
Copy link
Contributor Author

I found out a very hacky way for this:

- (void)setView:(UIView *)view hiddenAtEndOfAnimation:(BOOL)hidden atPage:(Page)page {

	IFTTTHideAnimation *hideAnimation = [[IFTTTHideAnimation alloc] init];

	[hideAnimation setValue:view forKey:@"_view"];

	[hideAnimation addKeyframeForTime:page.left value:[NSNumber numberWithBool:!hidden]];
	[hideAnimation addKeyframeForTime:page.right - 1 value:[NSNumber numberWithBool:!hidden]];

	[hideAnimation addKeyframeForTime:page.right value:[NSNumber numberWithBool:hidden]];

	[self.contentAnimator addAnimation:hideAnimation];
}

which it works but it's ugly. I don't understand why was it crashing with New value must have the same interpolatable type as existing keyframe values. though, when I was using @(hidden).

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

1 participant