You have to dismiss modal view controller (C) and popToRootViewController in NavigationController. Try the code below in C View Controller:
let presentingVC = self.presentingViewController!
let navigationController = presentingVC is UINavigationController ? presentingVC as? UINavigationController : presentingVC.navigationController
navigationController?.popToRootViewControllerAnimated(false)
self.dismissViewControllerAnimated(true, completion: nil)
In this case user will see just dismissing modal view controller. Pop to Root View Controller in Navigation Controller will be made in backgroud.
Another option is dismissing Modal View Controller and after that pop to the Root View Controller with animation, then user will see everything.
Code for that below:
let presentingVC = self.presentingViewController!
let navigationController = presentingVC is UINavigationController ? presentingVC as? UINavigationController : presentingVC.navigationController
self.dismissViewControllerAnimated(true, completion: { () -> Void in
navigationController?.popToRootViewControllerAnimated(true)
return
})