启动动画

//获取启动视图

        let vc =UIStoryboard(name:"LaunchScreen", bundle:nil)

            .instantiateViewController(withIdentifier:"launch")

        let launchview = vc.view!

        let delegate = UIApplication.shared.delegate

        delegate?.window!!.addSubview(launchview)


//播放动画效果,完毕后将其移除

        UIView.animate(withDuration:1, delay:1.5, options: .beginFromCurrentState,

        animations: {

                launchview.alpha=0.0

                let transform = CATransform3DScale(CATransform3DIdentity, 1.5, 1.5, 1.0)

                launchview.layer.transform= transform

        }) { (finished) in

            launchview.removeFromSuperview()

        }

你可能感兴趣的:(启动动画)