You can only dismiss one view controller at a time. Try this
@IBAction func backButtonTapped(sender: AnyObject) {
self.presentingViewController?.dismissViewControllerAnimated(true, completion: {
let secondPresentingVC = self.presentingViewController?.presentingViewController;
secondPresentingVC?.dismissViewControllerAnimated(true, completion: {});
});
}