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

update the model layer with the final state in case inAnimation and outA... #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ADTransitionController.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pod::Spec.new do |s|
s.name = "ADTransitionController"
s.version = "1.1.0"
s.summary = "Drop-in replacement for UINavigationController with custom transition animations."

s.description = <<-DESC
ADTransitionController is a drop-in replacement for UINavigationController with custom transition animations. Concept was described on Applidium's [website][http://applidium.com/en/news/uinavigationcontroller_with_custom_transitions/].
DESC

s.homepage = "http://applidium.github.io/ADTransitionController/"
s.screenshots = "http://applidium.com/en/news/uinavigationcontroller_with_custom_transitions/adtransitioncontroller.jpg?13739936"
s.license = { :type => "NetBSD", :file => "LICENSE" }
s.authors = { "Applidium" => "contact@applidium.com" }
s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/applidium/ADTransitionController.git", :tag => "v1.1.0" }
s.source_files = "ADTransitionController/**/*.{h,m}"
s.exclude_files = "TransitionDemo/**/*.{h,m}"
s.framework = "QuartzCore"
s.requires_arc = false
end
13 changes: 13 additions & 0 deletions ADTransitionController/ADTransitionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,19 @@ - (void)_transitionfromView:(UIView *)viewOut toView:(UIView *)viewIn withTransi
ADDualTransition * dualTransition = (ADDualTransition *)transition;
[viewIn.layer addAnimation:dualTransition.inAnimation forKey:nil];
[viewOut.layer addAnimation:dualTransition.outAnimation forKey:nil];

// If in and out animation are just CABasicAnimation
// we can easily set the final state to the model layer.
// If not, something should be made.. TODO: handle this situation!
if ([dualTransition.inAnimation isKindOfClass:[CABasicAnimation class]]) {
CABasicAnimation *inAnimation = transition.type == ADTransitionTypePush ? dualTransition.inAnimation : dualTransition.outAnimation;
[viewIn.layer setValue:[inAnimation toValue] forKeyPath:[inAnimation keyPath]];
}
if ([dualTransition.outAnimation isKindOfClass:[CABasicAnimation class]]) {
CABasicAnimation *outAnimation = transition.type == ADTransitionTypePush ? dualTransition.outAnimation : dualTransition.inAnimation;
[viewOut.layer setValue:[outAnimation toValue] forKeyPath:[outAnimation keyPath]];
}

} else if (transition != nil) {
NSAssert(FALSE, @"Unhandled ADTransition subclass!");
}
Expand Down