美文网首页
iOS 由cell获取到controller

iOS 由cell获取到controller

作者: 咸鱼有只喵 | 来源:发表于2018-11-12 11:42 被阅读10次

在简书上看到了一个很牛逼的方法,记录下来,不用响应链两行搞定;

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

相关文章

网友评论

      本文标题:iOS 由cell获取到controller

      本文链接:https://www.haomeiwen.com/subject/nramxqtx.html