我编写了以下函数来实现自定义动画:
func AnimateIt()
{
println("here")
var mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
var aNavigationController2 = mainStoryboard.instantiateViewControllerWithIdentifier("TNavigationController") as! UINavigationController
var aInfo = aNavigationController2.viewControllers[0] as! AInfoVC
self.view.addSubview(aInfo.view)
self.view.bringSubviewToFront(aInfo.view)
self.tabBarController?.tabBar.hidden = false
UIView.animateWithDuration(2.0, animations: {
aInfo.view.frame.origin.x += self.view.frame.width
}) { (finished) -> Void in
aInfo.view.removeFromSuperview()
}
}
' AInfoVC '有一个表格视图,在上面的动画开始时会消失。类似的功能适用于没有表视图的其他视图控制器。
提前致谢。