- 自定义UITableViewCell,用于添加UICollectionView
- 自定义UICollectionView,添加属性监听点击CollectionView内容时所在第行数
- 需将UITableView的代理和UICollectionView的代理放置在同一个Controller里,以便后续操作
自定义的UICollectionView如下:
@interface CustCollectionView : UICollectionView
@property (nonatomic, strong) NSIndexPath *rowIndex;
@end
自定义的UITableViewCell如下:
@interface CustTableCell : UITableViewCell
@property (nonatomic, strong) CustCollectionView *collection;
@end
@implementation CustTableCell
- (UICollectionView *)collection
{
if (!_collection) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.sectionInset = UIEdgeInsetsMake(10,