美文网首页
如何获取和iOS原生一样的动画过渡

如何获取和iOS原生一样的动画过渡

作者: 南国青天 | 来源:发表于2019-11-04 17:09 被阅读0次
    class ShareNavigationController: UINavigationController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            // Do any additional setup after loading the view.
        }
    
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    
    
        override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
    
            self.view.transform = CGAffineTransform(translationX: 0, y: self.view.frame.size.height)
    
            UIView.animate(withDuration: 0.3, delay: 0, options: UIViewAnimationOptions(rawValue: 7 << 16 | UIViewAnimationOptions.allowAnimatedContent.rawValue), animations: {
                self.view.transform = .identity
            }, completion: nil)
        }
    
    }
    

    参考文章

    相关文章

      网友评论

          本文标题:如何获取和iOS原生一样的动画过渡

          本文链接:https://www.haomeiwen.com/subject/ifbdbctx.html