iOS 判斷是push仍是present下面這種方法判斷成功了 if (self.presentingViewController) { [weakSelf dismissViewControllerAnimated:YES completion:nil]; } else { [weakSelf.navigationController popViewControllerAnimated:YES]; }