CoreTransition
iOS framework for impressive transition animations between views. Built using Swift, and supports a lot of animations to navigate to a view or back to the first view.
Video Demo
RPReplay_Final1659141075.MP4
Supported Transitions
- Fade
- Zoom
- Cover
- Slide
- Curtain
- Curtain Zoom
- Door
- Window
- Puzzle Board
- Morph
- Matched Morph (In progress)
Prerequisites
- macOS Big Sur, or later
- Xcode 12.3+
- Simulator or iPhone device with iOS 14.3+
Install CoreTransition (using CocoaPods)
- Make sure you have CocoaPods installed.
- Update local pod repo using command
pod repo update
orpod repo update trunk
. - Open Terminal from your project folder, and run commad
pod init
. - Add
pod 'CoreTransition'
inside Podfile, and runpod install
. - Use the framework like the code below, and call
dismiss(animated: true)
in the preseted view.
Code Example
import UIKit
import CoreTransition
class ViewController: UIViewController {
// MARK: - Properties
let transitionManager = CTTransitionManager()
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// Present the other view wherever suitable in code
applyTransition()
}
// MARK: - Methods
func applyTransition() {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "PresentedViewController") as! PresentedViewController
// Present vc with fade transition animation
// Change style and duration to get another awesome transition
transitionManager.transition(from: self, to: vc, style: .fade, duration: 1)
}
}
To present a UIViewController
using one of supported transitions but dismiss it in your own way, call transition with inline object of CTTransitionManager
like this:
CTTransitionManager().transition(from: self, to: vc, style: .fade)