我在集合视图上有一个点击手势功能,我正在使用传递数据到容器视图。
这里的整个想法是加载此容器视图,其中包含与点击手势来自哪个单元格相关联的信息。
所以我的功能看起来像这个
@IBAction func changeMix(sender: AnyObject) {
self.avPlayerController = AVPlayerController(nibName: "AVPlayerController", bundle: nil)
// I am getting data out of a array ready to send to AVPlayerController
var infoSend = mixInfoArray[1]
var urlSend = mixUrlArray[1]
// Sending the data
self.avPlayerController.url = urlSend
self.avPlayerController.info = infoSend
// Double checking to see if they contain the data(They do!!)
println(urlSend)
println(infoSend!)
}
在我的AVPlayerController类中,我得到了这个
class AVPlayerController: UIViewController {
var url: String!
var info: String!
@IBAction func playButton(sender: AnyObject) {
// Here Im checking to see if the data has been passed and I get Nil!
println(url)
println(info)
}
}