problen with transitions to another view

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!

Replies

What are the parameters of your segue ?

Also, that would be helpful to show us the code of the view controller being transitioned to.

The viewcontroller has three container each having its own viewcontroller.


When i come to the main ViewController all the other ViewControlles code get executed (ViewDidLoad)


Heres what it looks like when I use a Segue inInterface Builder.
Here I only have Cover Vertical, Flip Horizontal, Cross dissolve and Partial Curl.

I would like to use Slide From Right.


My problem is that the Segue in IB works smoothly, but does nat have the transition I need.

And if I do it in code it look chunky.

I tried to insert a photo, it show up under Edit but not elsewhere.

I don't know how ti insert images in thread.

>I don't know how ti insert images in thread.


Don't bother - we're not allowed to see them.

I don't know how ti insert images in thread.

DevForums does not currently let you post images (r. 22028729)-: I recommend you upload your image to some other site and post a link here. That’ll require moderator approval, but that’s easy.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Can anyone help me with my problem?

I recommend you post an image of the problem (per your post on 20 Oct and my reply that same day).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"