iOS|iOS 由cell获取到controller

【iOS|iOS 由cell获取到controller】在上看到了一个很牛逼的方法,记录下来,不用响应链两行搞定;

UICollectionView *collection = (UICollectionView *) self.superview; UIViewController *vc = (UIViewController *) collection.dataSource; [vc presentViewController:alertController animated:YES completion:nil];

    推荐阅读