Re: Put UICollectionView within UITableViewCell

2018-03-10 Thread Glen Huang
I’ll give it a shot, thank you very much > On 10 Mar 2018, at 10:27 AM, Cosmo Birch wrote: > > But you presumably know the width (i.e. the CollectionView width minus any > insets), and you can calculate the height based on that with NSString or > NSAttributedString boundingRect functions. Assu

Re: Put UICollectionView within UITableViewCell

2018-03-09 Thread Cosmo Birch
But you presumably know the width (i.e. the CollectionView width minus any insets), and you can calculate the height based on that with NSString or NSAttributedString boundingRect functions. Assuming you have a subclass for your CollectionViewCell, you can add a method to return your cell height

Re: Put UICollectionView within UITableViewCell

2018-03-09 Thread Glen Huang
@Cosmo My collection items contain label, so I don’t know the exact sizes before hand. @Gary In my case I actually also need to display section headers and section index titles, so using just a collection view probably won’t be easy I guess. — From the suggestions it seems it might be somethi

Re: Put UICollectionView within UITableViewCell

2018-03-09 Thread Gary L. Wade
I would suggest rethinking the table view enclosure and just use a collection view with headers and footers by way of the supplemental views. -- Gary L. Wade http://www.garywade.com/ > On Mar 9, 2018, at 8:00 AM, Glen Huang wrote: > > Hi, > > I asked a question about putting UICollectionView w

Re: Put UICollectionView within UITableViewCell

2018-03-09 Thread Cosmo Birch
Where I work we have spent a fair amount of trying unsuccessfully to get self-sizing collection view cells to work as described by Apple documentation with UICollectionViews that have any sort of complexity. I would suggest trying to implement the sizeForItemAtIndexPath delegate method to see if

Put UICollectionView within UITableViewCell

2018-03-09 Thread Glen Huang
Hi, I asked a question about putting UICollectionView within UITableViewCell on Apple Developer Forums (https://forums.developer.apple.com/thread/98176), but it doesn’t get many replies. I’m not sure if it’s ok to repost the question here. I apologize if it’s not. Here is the question: Hi, I'