7 Replies
      Latest reply: Oct 31, 2016 6:45 AM by eskimo RSS
      Nyt Liv Ivs Level 1 Level 1 (0 points)

        In ny app I have to switch between two viewcontroller.

         

        On the second viewcontroller I have three container views.

         

        If I make a Segue in Interface Builder  the transition is smooth but I cannot make it slide from right or slide from left.

         

        If I use code instead to make the transition I can make slide from right or slide from left, but i does not look good.

        It starts to slide, den suddently in the middle of the transition the new view(first container is shown)

         

        Is it possible to add a slide from right transition in the Interface Builder Segue?

        Or is it possible in code to make the transition smotth as an segue?

         

        This is how I make transition in Swift code:

         

                let vc = self.storyboard?.instantiateViewController(withIdentifier: "MyControllerName")
        
        
               let transition = CATransition()
               transition.duration = 0.4
               transition.type = kCATransitionPush
               transition.subtype = kCATransitionFromRight
        
        
                view.window!.layer.add(transition, forKey: "transition")
        
        
                present(vc!, animated: false, completion: nil)
        

         

        I hope someone can help me!