Top Related Projects
A toolkit for building responsive motion using Core Animation.
Elegant transition library for iOS & tvOS
A library used to create beautiful animations and transitions for iOS.
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
This component implements transition animation to crumble view-controller into tiny pieces.
Quick Overview
RZTransitions is an iOS library that provides a collection of custom UIViewController transitions and interactions. It offers a simple API for creating and managing custom transitions between view controllers, enhancing the user experience with smooth and visually appealing animations.
Pros
- Easy to implement custom transitions with minimal code
- Supports both push/pop and modal presentation styles
- Includes a variety of pre-built transition effects
- Extensible architecture allows for creating custom transitions
Cons
- Limited documentation and examples
- Not actively maintained (last update was several years ago)
- May require updates for compatibility with newer iOS versions
- Lacks support for SwiftUI
Code Examples
- Creating a simple fade transition:
let fadeTransition = RZTransition()
fadeTransition.animationTransition = RZTransitionsFade()
navigationController?.pushViewController(viewController, animated: true, withTransition: fadeTransition)
- Implementing a custom interaction:
class CustomInteraction: RZTransitionInteractionController {
override func beginInteraction(withViewController viewController: UIViewController, fromViewController: UIViewController, containerView: UIView, completion: @escaping () -> Void) {
// Custom interaction logic
}
}
let customInteraction = CustomInteraction()
rzTransition.interactionController = customInteraction
- Using a built-in card transition:
let cardTransition = RZTransition()
cardTransition.animationTransition = RZCardSlideAnimationController()
presentViewController(viewController, animated: true, withTransition: cardTransition)
Getting Started
- Install RZTransitions using CocoaPods by adding the following to your Podfile:
pod 'RZTransitions'
- Import the library in your Swift file:
import RZTransitions
- Create a transition object and set its animation:
let transition = RZTransition()
transition.animationTransition = RZTransitionsFade()
- Use the transition when presenting or pushing a view controller:
navigationController?.pushViewController(viewController, animated: true, withTransition: transition)
Competitor Comparisons
A toolkit for building responsive motion using Core Animation.
Pros of material-motion-swift
- More comprehensive animation framework with a focus on Material Design principles
- Offers a declarative API for creating complex animations and transitions
- Actively maintained with regular updates and improvements
Cons of material-motion-swift
- Steeper learning curve due to its more complex architecture
- Primarily focused on Material Design, which may not suit all design needs
- Requires more setup and configuration compared to simpler transition libraries
Code Comparison
RZTransitions:
let transition = RZZoomPushAnimationController()
navigationController.delegate = transition
navigationController.pushViewController(viewController, animated: true)
material-motion-swift:
let transition = TransitionContext(presenting: viewController)
let spring = SpringTo<CGPoint>(destination: .zero)
transition.runtime.addPlan(spring, to: viewController.view)
navigationController.pushViewController(viewController, animated: true)
Both libraries provide ways to create custom transitions, but material-motion-swift offers a more flexible and powerful approach at the cost of increased complexity. RZTransitions is simpler to implement for basic transitions, while material-motion-swift excels in creating more intricate and customizable animations that adhere to Material Design principles.
Elegant transition library for iOS & tvOS
Pros of Hero
- Written in Swift, offering better performance and type safety
- Supports more complex animations and transitions, including 3D transformations
- Provides a more declarative API, making it easier to create custom transitions
Cons of Hero
- Steeper learning curve due to its more advanced features
- May be overkill for simple transition needs
- Requires iOS 10.0+ and Swift 4.0+, limiting compatibility with older devices
Code Comparison
Hero:
hero.isEnabled = true
fromView.hero.id = "ironMan"
toView.hero.id = "ironMan"
RZTransitions:
[self.navigationController pushViewController:viewController
withTransitionCoordinator:[[RZZoomPushAnimationController alloc] init]];
Key Differences
- Hero uses a more modern, Swift-based approach, while RZTransitions is written in Objective-C
- Hero offers more advanced animation capabilities, whereas RZTransitions focuses on simpler, pre-defined transitions
- Hero's API is more declarative and flexible, allowing for easier customization of transitions
- RZTransitions may be easier to integrate into existing Objective-C projects or for developers more familiar with Objective-C
Both libraries aim to simplify custom view controller transitions in iOS apps, but Hero provides a more powerful and flexible solution at the cost of increased complexity and stricter system requirements.
A library used to create beautiful animations and transitions for iOS.
Pros of Motion
- More comprehensive animation framework with a wider range of features
- Active development and maintenance, with recent updates
- Extensive documentation and examples
Cons of Motion
- Steeper learning curve due to its broader scope
- Potentially heavier impact on app size and performance
Code Comparison
RZTransitions:
let transition = RZCirclePushTransition()
transition.transitionDuration = 0.5
transition.backgroundColor = .red
navigationController?.delegate = transition
Motion:
view.animate(.fadeIn)
view.animate(.scale(2))
view.animate(.rotate(180))
view.animate(.translate(y: 100))
view.animate(.backgroundColor(.blue))
Key Differences
- RZTransitions focuses specifically on view controller transitions
- Motion offers a more flexible and diverse set of animations beyond transitions
- RZTransitions uses a delegate-based approach, while Motion employs a more declarative syntax
- Motion provides more granular control over individual element animations
Use Cases
- RZTransitions: Ideal for projects primarily needing custom view controller transitions
- Motion: Better suited for apps requiring complex, multi-element animations throughout the UI
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
Pros of animated-tab-bar
- More focused on tab bar animations, providing a rich set of pre-built animations
- Higher star count and more recent updates, indicating active maintenance
- Supports both Swift and Objective-C
Cons of animated-tab-bar
- Limited to tab bar animations, less versatile for other transition types
- May require more setup for custom animations beyond the provided set
- Potentially higher learning curve for developers new to custom UI components
Code Comparison
animated-tab-bar:
let animatedTabBar = RAMAnimatedTabBarController()
let item1 = RAMAnimatedTabBarItem(title: "Home", image: UIImage(named: "home"), tag: 1)
item1.animation = RAMBounceAnimation()
animatedTabBar.viewControllers = [homeVC]
animatedTabBar.items = [item1]
RZTransitions:
RZTransitionsManager *transitionManager = [RZTransitionsManager shared];
[transitionManager setDefaultPushPopAnimationController:[[RZZoomPushAnimationController alloc] init]];
[transitionManager setDefaultPresentDismissAnimationController:[[RZCardSlideAnimationController alloc] init]];
Summary
While animated-tab-bar excels in providing polished tab bar animations with active maintenance, RZTransitions offers a broader range of transition types for various UI elements. The choice between the two depends on the specific needs of the project, with animated-tab-bar being more suitable for projects focusing on tab bar customization, and RZTransitions offering more flexibility for diverse transition requirements.
A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
Pros of BubbleTransition
- Simpler implementation focused on a specific transition effect
- Lightweight and easy to integrate into existing projects
- Customizable bubble color and duration
Cons of BubbleTransition
- Limited to a single transition style (bubble effect)
- Less flexibility compared to RZTransitions' multiple transition types
- Fewer options for customizing the transition behavior
Code Comparison
BubbleTransition:
let transition = BubbleTransition()
transition.startingPoint = button.center
transition.transitionMode = .present
transition.bubbleColor = .white
transition.duration = 0.5
RZTransitions:
RZCirclePushAnimationController *pushAnimationController = [[RZCirclePushAnimationController alloc] init];
pushAnimationController.transitionDuration = 0.5;
pushAnimationController.circleColor = [UIColor whiteColor];
pushAnimationController.circleOrigin = button.center;
Both libraries offer similar functionality for creating circular transition effects, but RZTransitions provides a wider range of transition types and more customization options. BubbleTransition is more focused on simplicity and ease of use for a specific transition style.
This component implements transition animation to crumble view-controller into tiny pieces.
Pros of StarWars.iOS
- Offers a unique and visually appealing Star Wars-themed transition effect
- Provides a specialized animation that can enhance user experience in themed apps
- Includes a demo project for easy implementation and customization
Cons of StarWars.iOS
- Limited to a specific theme, which may not be suitable for all applications
- Less versatile compared to RZTransitions, which offers multiple transition types
- May require more customization to fit non-Star Wars themed apps
Code Comparison
StarWars.iOS:
let transition = STWStarWarsTransition()
transition.duration = 2.0
transition.type = .FromTop
viewController.modalPresentationStyle = .Custom
viewController.transitioningDelegate = transition
RZTransitions:
RZZoomAlphaAnimationController *animator = [[RZZoomAlphaAnimationController alloc] init];
animator.fadeColor = [UIColor whiteColor];
animator.transitionTime = 0.5f;
self.navigationController.delegate = animator;
Both repositories provide custom transition animations for iOS applications. StarWars.iOS focuses on a specific Star Wars-themed transition, while RZTransitions offers a variety of transition types. RZTransitions is more versatile and can be used in a wider range of applications, whereas StarWars.iOS provides a unique and visually striking effect that may be perfect for themed apps or special use cases.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple.
Installation
CocoaPods (Recommended)
Add the following to your Podfile:
pod 'RZTransitions'
RZTransitions follows semantic versioning conventions. Check the releases page for the latest updates and version history.
Manual Installation
Copy and add all of the files in the RZTransitions
directory (and its subdirectories) into your project.
Setting a New Default Transition
Swift
RZTransitionsManager.shared().defaultPresentDismissAnimationController = RZZoomAlphaAnimationController()
RZTransitionsManager.shared().defaultPushPopAnimationController = RZCardSlideAnimationController()
Objective-C
id<RZAnimationControllerProtocol> presentDismissAnimationController = [[RZZoomAlphaAnimationController alloc] init];
id<RZAnimationControllerProtocol> pushPopAnimationController = [[RZCardSlideAnimationController alloc] init];
[[RZTransitionsManager shared] setDefaultPresentDismissAnimationController:presentDismissAnimationController];
[[RZTransitionsManager shared] setDefaultPushPopAnimationController:pushPopAnimationController];
When Presenting a View Controller
Swift
self.transitioningDelegate = RZTransitionsManager.shared()
let nextViewController = UIViewController()
nextViewController.transitioningDelegate = RZTransitionsManager.shared()
self.presentViewController(nextViewController, animated:true) {}
Objective-C
[self setTransitioningDelegate:[RZTransitionsManager shared]];
UIViewController *nextViewController = [[UIViewController alloc] init];
[nextViewController setTransitioningDelegate:[RZTransitionsManager shared]];
[self presentViewController:nextViewController animated:YES completion:nil];
When creating a Navigation Controller ( or use RZTransitionsNavigationController )
Swift
let navigationController = UINavigationController()
navigationController.delegate = RZTransitionsManager.shared()
Objective-C
UINavigationController *navigationController = [[UINavigationController alloc] init];
[navigationController setDelegate:[RZTransitionsManager shared]];
Specifying Transitions for Specific View Controllers
Swift
RZTransitionsManager.shared().setAnimationController( RZZoomPushAnimationController(),
fromViewController:self.dynamicType,
toViewController:RZSimpleCollectionViewController.self,
forAction:.PushPop)
Objective-C
// Use the RZZoomPushAnimationController when pushing from this view controller to a
// RZSimpleCollectionViewController or popping from a RZSimpleCollectionViewController to
// this view controller.
[[RZTransitionsManager shared] setAnimationController:[[RZZoomPushAnimationController alloc] init]
fromViewController:[self class]
toViewController:[RZSimpleCollectionViewController class]
forAction:RZTransitionAction_PushPop];
Hooking up Interactors
Swift
override func viewDidLoad() {
super.viewDidLoad()
self.presentInteractionController = RZVerticalSwipeInteractionController()
if let vc = self.presentInteractionController as? RZVerticalSwipeInteractionController {
vc.nextViewControllerDelegate = self
vc.attachViewController(self, withAction:.Present)
}
}
override func viewWillAppear(animated: Bool)
{
super.viewWillAppear(animated)
RZTransitionsManager.shared().setInteractionController( self.presentInteractionController,
fromViewController:self.dynamicType,
toViewController:nil,
forAction:.Present)
}
Objective-C
@property (nonatomic, strong) id<RZTransitionInteractionController> presentInteractionController;
- (void)viewDidLoad
{
[super viewDidLoad];
// Create the presentation interaction controller that allows a custom gesture
// to control presenting a new VC via a presentViewController
self.presentInteractionController = [[RZVerticalSwipeInteractionController alloc] init];
[self.presentInteractionController setNextViewControllerDelegate:self];
[self.presentInteractionController attachViewController:self withAction:RZTransitionAction_Present];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// Use the present interaction controller for presenting any view controller from this view controller
[[RZTransitionsManager shared] setInteractionController:self.presentInteractionController
fromViewController:[self class]
toViewController:nil
forAction:RZTransitionAction_Present];
}
Features
- A comprehensive library of animation controllers
- A comprehensive library of interaction controllers
- Mix and match any animation controller with any interaction controller
- A shared instance manager that helps wrap the iOS7 custom transition protocol to expose a friendlier API
You can use any of the animation controllers or interaction controllers without the RZTransitionsManager and simply use them with the iOS7 custom View Controller transition APIs.
Maintainers
Contributors
License
RZTransitions is licensed under the MIT license. See the LICENSE
file for details.
Top Related Projects
A toolkit for building responsive motion using Core Animation.
Elegant transition library for iOS & tvOS
A library used to create beautiful animations and transitions for iOS.
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion
A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
This component implements transition animation to crumble view-controller into tiny pieces.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot