Number: 011, Date: 2024-03-18

2024.03.11 ~ 2024.03.17

πŸ“± CollectionView Compositional Layout


Situations that arise when using Compositional Layout:

  1. Cell Touch
    • When a cell is touched and you want to change the UI, inheriting isSelected to modify the UI when the value changes can make it difficult to implement detailed custom actions. Therefore, you might consider using conditions or flags in the cellForRowAt method to set the UI for selected and unselected cells.
  2. Cell Highlight
    • There are cases when a cell should not be highlighted when touched. While you can set selectionStyle to none for UITableViewCell, UICollectionViewCell does not support this. Thus, I modified the shouldHighlightItemAt method to ensure that the specific cell is not highlighted. However, returning false in this method causes the cell to not be touchable, so I need to consider other solutions.
  3. Hiding Section Headers and Footers and Modifying Section Heights
    • For example, if you want to modify or hide the height of the section’s header and footer when a cell is touched, reloading the collection view resets the collectionViewLayout. If you want to hide the section footer, you can inject only the section header into section.boundarySupplementaryItems, or if you want to change the footer height, you can adjust the height of the footer. β†’ In other words, when reloading, the layout needs to be reset.
  4. Text Truncation Issue in Tag List UI
    • When implementing the tag list UI using Compositional Layout, reloading causes the cell width to be estimated, leading to a text truncation issue in the label. I attempted to resolve this by adding arbitrary text in prepareForReuse or trying to reset the layout, but it did not work. I looked into the estimation calculation method, but it seems Apple does not provide specific details on how the width is calculated. I need to investigate the exact cause of this issue in more detail later.

πŸš€ UI Related Issues


πŸ™‹πŸ»β€β™‚οΈ Other Notes


  1. The STALE tag appeared in the Bitbucket Pull Request list, indicating that the PR has been open longer than usual or has not been updated recently.