'Animated menu in swift UIKit

i'm trying to present in my ViewController(which i will call main VC) and a MenuViewController . I've created MenuViewController with 1 view(which i've set like clear) and 2 views in it(1 is with tableView and button; second is bgcolor black with alpha 0.3). PictureOfMenuViewController

What I'm trying to do:

to OVERLAY this menuVC on my ViewController with animation from right to left I tried to do it (in my main VC) , like this :

 @IBAction func menuButtonTapped(_ sender: Any) {
        menuViewController = MenuViewController()
        let transition = CATransition()
        transition.duration = 1
        transition.type = CATransitionType.push
        transition.subtype = CATransitionSubtype.fromRight
        view.window?.layer.add(transition, forKey: kCATransition)
        self.present(menuViewController, animated: false)

but it PUSHES it instead of overlaying , and doing like screenshot of mainVC My question is : how can i create an animation from right to left, is it possible , or like custom CATransitionType??



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source