# # # introduction
A custom transition animation set was written during this time, and a variety of custom transitions can be implemented with just one line of code. This is the source address WXSTransition you can go to download to have a look.
### Transition Animation Asset is a transition animation asset.
In normal development, some transition animations are sometimes needed to add some vitality to the interface adjustment, and implementing these animations is relatively tedious. To make it easier to implement transitions, I wrote this interface transition animation set. Adjust the interface, as long as a line of code can achieve this animation. There are about 50 kinds of animations, including those provided by the system.
### Use method
#import “UINavigationController+ wxstransition.h”
#####2. Call Push with one line of code:
[self.navigationController wxs_pushViewController:(UIViewController *) animationType:(WXSTransitionAnimationType)];Copy the code
Present:
[self wxs_presentViewController:(UIViewController *) animationType:(WXSTransitionAnimationType) completion:^{
}];Copy the code
WXSTransitionAnimationType is animated transitions type, through the selection of the enumeration transitions animation you want.
#####3. Attribute modification is supported
[self wxs_presentViewController:<#(UIViewController *)#> makeTransition:^(WXSTransitionManager *transition) {
transition.animationType = WXSTransitionAnimationTypePointSpreadPresent;
transition.animationTime = 1;
}];Copy the code
You can use transition to set the animation time, type, and other properties
#####4. Special call
For animations like point Spread and ViewMoveToNextVC, you need a startView. Just point the startView of the target controller to this view.
DetailViewController *vc = [[DetailViewController alloc] init];
CollectionViewCell *cell = (CollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
vc.startView = cell.imgView;
[self.navigationController wxs_pushViewController:vc makeTransition:^(WXSTransitionManager *transition) {
transition.animationType = WXSTransitionAnimationTypeViewMoveToNextVC;
transition.animationTime = 1;
}];Copy the code
### animation renderings
##### Custom animation
###### system animation iOS itself actually has a lot of good transition animation, in this transition animation set has also been encapsulated, using the same method as custom transition animation. Push:
[self.navigationController wxs_pushViewController:<#(UIViewController *)#> animationType:<#(WXSTransitionAnimationType)#>];Copy the code
Present:
[self wxs_presentViewController:<#(UIViewController *)#> animationType:<#(WXSTransitionAnimationType)#> completion:<#^(void)completion#>]Copy the code
Words after # # #
Now is the first version, originally intended to support interactive gestures, but some animations using interactive gestures have many problems, so this version is removed, we are going to add some functions in the future version: Add some cool transition animation 2, support interactive gesture 3, provide custom animation interface, so that users want to achieve their own transition animation, do not need to achieve a variety of agents and other tedious work, focus on fromVC, and toVC animation logic.
Finally, the Gittub link. WXSTransition welcome to download and use, remember to give a star. If you have any ideas, you can exchange them and let us make progress together.