BSMosaicFlowLayout
Custom layout which allow you to create nice mosaics.
Install / Use
/learn @sssbohdan/BSMosaicFlowLayoutREADME
BSMozaicFlowLayout
Subclass of UICollectionViewLayout which allow you to create nice Mozaic Layout.

Usage
Set FlowLayoutDelegate
BSMozaicLayout *bsMozaicLayout = (BSMozaicLayout *)self.collectionView.collectionViewLayout;
bsMozaicLayout.delegate = self;
bsMozaicLayout.innerCellInset = 3.f;
Implement UICollectionViewDelegate/DataSource and BSMozaicDelegate.
- (CGSize)blockPrimitiveSizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
CGSize blockSize = [self getSizeForItemAtIndex:indexPath.row];
return blockSize;
}
- (NSInteger)countOfColumnInMozaic
{
return 5;
}
- (CGSize)getSizeForItemAtIndex:(NSUInteger)index
{
index %= 5;
if (!index)
return CGSizeMake(1, 1);
else if (index == 1)
return CGSizeMake(1, 2);
else if (index == 2)
return CGSizeMake(1, 1);
else if(index == 3)
return CGSizeMake(2, 1);
else if (index == 4)
return CGSizeMake(1, 1);
return CGSizeZero;
}
Installation
-
Import file
#import "BSMozaicLayout.h"
-
Add the layout as the subclass of your UICollectionViewLayout.

Author
Problems ? Suggestions? Send to me! bbbsavych@gmail.com
Related Skills
node-connect
341.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.4kCommit, push, and open a PR
