これがうまくいったので、私のソリューションを皆さんと共有したいと思いました。
UITableView
と入れ子に必要なデリゲートとデータソースを設定した後、次のように最初の選択可能なビューUICollectionView
を作成できますUICollectionView
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
[tableViewCell bringSubviewToFront:tableViewCell.yourCollectionView];
return cell;
}
これにより、UICollectionView
デリゲートを介して選択できる最初のものになります
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
ビューの他の部分は、UITableView
デリゲートを使用して選択されます
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
お役に立てれば!