I would switch the order of `poppedViewControllers` and `presentedViewController`. The latter will always have a value, but the former might be nil if it were a push instead of a pop.