Questions tagged [uicollectionviewcompositionallayout]

206 questions
3
votes
3 answers

Compositional Layouts and broken self-sized cells

I'm using relatively simple compositional layout, and it works, but in some cases last one or two cells in my UICollectionView seems to be with broken width. My collectionView consists of cells with dynamic width and static height. I can calculate…
3
votes
0 answers

UICollectionViewCompositionalLayout is it possible to create a PinterestLayout?

Can i use UICollectionViewCompositionalLayout to create a Pinterest / Waterflow like layout? the closes was with func buildLayout() -> UICollectionViewCompositionalLayout { // cells let itemSize = NSCollectionLayoutSize(widthDimension:…
3
votes
1 answer

How to deal with inconsistent behavior when change snapshot animatedDifferences value?

I'll start with explanation how things suppose to work: I have collection view with compositional layout and diffable data source. Cells are representing tasks, which user can click on and set as done for today, cells have different appearance…
3
votes
1 answer

Setting collection view layout to compositional layout using storyboard

How would I be able to change collection view flow layout to a compositional layout from storyboard. So I have a TabBarController class that contains 3 nav controllers that I init from storyboard looks like this. //Storyboard is an enum that…
2
votes
1 answer

applying rounded corner to a section using background view in UICollectionViewCompositionalLayout

I would like to make a list layout with Grouped Rounded Rect style using UICollectionViewCompositionalLayout. Am not able to get the background Decoration item applied to the section header. Using NSCollectionLayoutDecorationItem, I was able to get…
2
votes
1 answer

How to create a Stretchy Header for UICollectionViewCompositionalLayout with multiple sections?

This is my first time implementing UICollectionViewCompositionalLayout and im confused on how to implement a Stretchy Header here. Right now I have just modified the dataSource.supplementaryViewProvider function to include my custom HeaderView but I…
2
votes
1 answer

Swift - CompositionalLayout - collection view cell height not calculated based on Image height

I am using Compositional Layout plus Diffable Data Source to display images in a UICollectionView from Photo Album using PhotoKit's Cached Image Manager in a single column. I would like the image cell to be the entire width of the collection view…
2
votes
0 answers

Changing compositional layout on UICollectionView makes cells disappear

I have a problem while switching compositional layouts to activate and deactivate orthogonal scrolling makes the cells disappear. Here is a video: I use exactly the same layout except for orthogonal scrolling: section.orthogonalScrollingBehavior =…
2
votes
0 answers

Is it safe to use snapshot section identifiers for creating the UICollectionViewCompositionalLayout?

I am creating my layout based on the section identifiers, which I am appending to the snapshot like mentioned. Is it safe to use like this? var compositionalLayout: UICollectionViewLayout { let layout = UICollectionViewCompositionalLayout {…
Praveen Kokkula
  • 260
  • 1
  • 3
  • 11
2
votes
0 answers

collectionView with compositional layout, setcontentoffset position miss because dynamic height

i use collectionView with compositional layout and diffableDataSource collectionview cells are self sizing. func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { currentSection = indexPath.row if let…
ga-yo
  • 123
  • 1
  • 2
  • 11
2
votes
1 answer

Detect userEvent/pan/scroll on orthogonal sections in UICollectionViewCompositionalLayout

I am using autoScroll on an orthogonal section of the collectionView using compositional layout. I need to invalidate the autoscroll timer as soon as the user manually scrolls the section. I could use scrollViewDidBeginDragging /…
2
votes
3 answers

Unwanted space between Collection View cells Compositional Layout

I am using Collection View for a scene. I created a custom compositional layout which is like down below. However, while scrolling there is an unwanted space between the second part of the cells. It has occurred in different cell types. I checked…
2
votes
0 answers

UICollectionViewCompositionalLayout two group in section

I use UICollectionViewCompositionalLayout to create UICollectionView, I want the first Item to occupy half the width, other Items to occupy 1/4 of the width, items grow downward, like this: https://i.stack.imgur.com/uO5R9.png but I can't achieve…
2
votes
1 answer

Am I correct in thinking collection view drag and drop + compositional layout just don't work together?

Update on July 8 2022 - Apple appears to have fixed the two finger scrolling bug, although the interaction is still a bit buggy. Collection view + compositional layout + diffable data source + drag and drop does not seem to work together. This is…
2
votes
0 answers

Custom insert / delete animations in a modern UICollectionView

How to apply custom insert / delete animation for collection view cells when using UICollectionViewCompositionalLayout with UICollectionViewDiffableDataSource? Previously I did it by subclassing UICollectionViewLayout and overriding…