override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "stopRecording" {
let playSoundsVC = segue.destination as! PlaySoundsViewController
let recordedAudioURL = sender as! URL
playSoundsVC.receivedAudio = recordedAudioURL
}
}
问题是我的Xcode生成错误
“ PlaySoundsViewController”类型的值没有成员“ receivedAudio”
答案 0 :(得分:0)
为此,destinationVC应该看起来像这样
class PlaySoundsViewController:UIViewController {
var receivedAudio:URL?
.....
}