How to present view controller from right to left in iOS using Swift

前端 未结 12 1200
悲&欢浪女
悲&欢浪女 2020-12-04 06:03

I am using presentViewController to present new screen

let dashboardWorkout = DashboardWorkoutViewController()
presentViewController(dashboardWorkout, anima         


        
12条回答
  •  Happy的楠姐
    2020-12-04 06:38

    Try this.

    let transition: CATransition = CATransition()
    transition.duration = 0.3
    
    transition.type = kCATransitionReveal
    transition.subtype = kCATransitionFromLeft
    self.view.window!.layer.addAnimation(transition, forKey: nil)
    self.dismissViewControllerAnimated(false, completion: nil)
    

提交回复
热议问题