iOS Swift Tutorial: Create a Circular Transition Animation (Custom UIViewController Transitions)

Daniel Autenrieth · 111K views · 2016 · 32:15

Open on YouTube

Software (other)UX & UI designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the source tutorial for their CircularTransition code, and answerers point to it when someone needs a custom animated transition between view controllers.

Recommended by 1 people across 1 different months, 2016 to 2020.

What it is

A 32-minute iOS Swift tutorial by Daniel Autenrieth (Brian Advent's channel) that builds a circular reveal transition between two view controllers using a custom UIViewControllerAnimatedTransitioning class. The code is available on GitHub and the result can serve as a menu or feature highlight animation.

What people said

Recommends Brinkster · 2019-11 · Stack Overflow · on “Swift - Present a UIView (not a ViewController)”

Well, there are two answers I can think of: 1) If you want, you could just animate it in from the bottom using UIView.animate() on a y-position constraint it has, or on its layer's y-position attribute. You could then attach a UISwipeGestureRecognizer to it so that if you swipe down on it, it will animate back down. 2) Make your views that you'd like to present viewControllers and have them be presented with a custom modal animation. This sounds like more work than you wanna do though. Here's a cool tutorial on youtube that walks you through how to create a custom animation transition between 2 view controllers: [this video] However, as far as I know, those .dismiss and .present methods are only

Cites Bright · 2016-10 · Stack Overflow · on “Display 2 view controllers at the same time with animation”

I'm following this awesome video [this video] to create a custom transition for my project, because I'm developing for the iPad, so instead of presenting destination view controller full screen, I want to have it occupy half of the screen like this: [LINK] My code of the custom transition class is: class CircularTransition: NSObject { var circle = UIView() var startingPoint = CGPoint.zero { didSet { circle.center = startingPoint } } var circleColor = UIColor.white var duration = 0.4 enum circularTransitionMode: Int { case present, dismiss } var transitionMode = circularTransitionMode.present } extension CircularTransition: UIViewControllerAnimatedTransitioning { func transitionDuration(using tran

Cites huberdo · 2017-01 · Stack Overflow · on “How to animate a transition between 3 or more view controllers with buttons in SWIFT 3?”

I'm relatively new in programming and currently try to build an app with three (if possible more) view controllers. I did a tutorial ( [this video] ) in which I learned to animate between two view controllers after pressing a custom button. This all worked perfectly. But now I try to implement another view controller (ThirdViewController) and a second button (showThirdVCButton). The transitioning works perfectly for both buttons but the animation is set back to the standard animation. This is my code in the initial view controller: import UIKit class ViewController: UIViewController, UIViewControllerTransitioningDelegate { @IBOutlet weak var showSecondVCButton: UIButton! @IBOutlet weak var showTh

Cites Victor · 2017-01 · Stack Overflow · on “Swift - Type 'CircularTransition' does not conform to protocol 'UIViewControllerAnimatedTransitioning'”

class CircularTransition: NSObject { var circle = UIView() var startingPoint = CGPoint.zero { didSet { circle.center = startingPoint } } var circleColor = UIColor.whiteColor() var duration = 0.3 enum CircularTransitionMode:Int { case present, dismiss, pop } var transitionMode:CircularTransitionMode = .present } extension CircularTransition:UIViewControllerAnimatedTransitioning { func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { return duration } func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { let containerView = transitionContext.containerView if transitionMode == .present { if let presentedView

Cites rubenspessoa · 2017-06 · Stack Overflow · on “View controller after transition is fitting its contraints to size class instead of device”

First of all, I followed this tutorial: [this video] and then I used this transition in a real project where I work, but since then I am facing a problem with it. A problem that I can't quite understand why it is happening. Perhaps you could help me out. What's happening is the following: I'm making a tutorial for my app using this transition. In the view controller where I set the text for the tutorial, I set constraints for top, bottom, leading and trailing to 0. Thus, it should fit the view controller to the edges, right? But it only happens when I have chosen in size class the same device that I am using in the simulator. For instance, I must run an iPhone 7 plus simulator AND set the size cl

Cites Stryka · 2020-05 · Stack Overflow · on “Receiving issue: Could not cast value of type 'UIViewController' trying to animate on Xcode”

override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let secondVC = segue.destination as! SettingsViewController //error is marked here secondVC.transitioningDelegate = self secondVC.modalPresentationStyle = .custom } func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { transition.transitionMode = .present transition.startingPoint = settingsButton.center transition.circleColor = UIColor.white return transition } func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { transition.transitionMode = .dismiss transit