Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否从UICollectionView中选择视频?_Ios_Swift_Uicollectionview - Fatal编程技术网

Ios 是否从UICollectionView中选择视频?

Ios 是否从UICollectionView中选择视频?,ios,swift,uicollectionview,Ios,Swift,Uicollectionview,我有UICollectionView,我将照片库中的所有视频添加到一个数组中,并将它们显示在CollectionViewCells中 我希望能够从此UICollectionView中选择视频 我如何做到这一点。谢谢,很简单。您应该使用“didSelectItemAt indexPath”方法: func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { le

我有UICollectionView,我将照片库中的所有视频添加到一个数组中,并将它们显示在CollectionViewCells中

我希望能够从此UICollectionView中选择视频


我如何做到这一点。谢谢,很简单。您应该使用“didSelectItemAt indexPath”方法:

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    let cell = collectionView.cellForItem(at: indexPath)
    // and now you access your view that is in the cell

}