How to transparent background when pushViewcontroller

2.9k views Asked by At

how to transparent background when pushViewcontroller?? just like.. modal view over full screen (programmatically, not using storyboard, not using present modal)


first view controller > Button Action >

    let transition = CATransition()
    transition.duration = 0.5
    transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
    transition.type =  kCATransitionPush //kCATransitionFade
    transition.subtype = kCATransitionFade

    self.navigationController?.view.layer.add(transition, forKey: nil)

    let testVC = SecondViewController()

    if let existVC = self.navigationController {
        existVC.pushViewController(testVC, animated: false)
    }

second View Controller

super.viewDidLoad()
self.view.backgroundColor = UIColor.clear

The result is... black background. how to transparent background??

0

There are 0 answers