{ self.performSegue(withIdentifier: "showFuga", sender: sender.tag) } @IBAction private func didTapPiyoButton(_ sender: UIButton) { self.performSegue(withIdentifier: "showPiyo", sender: sender.currentTitle) } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let vc = segue.destination as? FugaViewController { if let value = sender as? Int { vc.value = value } } else if let vc = segue.destination as? PiyoViewController { if let value = sender as? String { vc.value = value } } } }