I have several view controllers inherited from UIViewController. The views are embedded in Tab bar controller. I implement a custom view transition controller so that view can be switched when I tap on tabbar item. Is it possible that I can know what exact the toVC and fromVC is so that I can perform different view transition? It seems that as! does not do the trick. The variables are not being set to true when I use as?. What is correct way to do casting or any other way to check what view it is? Thanks
func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
var detail = false
var item = false
if var controller = toVC as? DetailViewController {
detail = true
}
if var controller = toVC as? ItemViewController {
item = true
}
...
return threeDAnimationController
}