Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Latest commit

 

History

History
37 lines (24 loc) · 790 Bytes

File metadata and controls

37 lines (24 loc) · 790 Bytes

ANDistributedFlowLayout

ANDistributedFlowLayout is a subclass of UICollectionViewFlowLayout which distributes cells evenly in across each row.

Usage

# In your Podfile

pod 'ANDistributedFlowLayout'

Objective-C:

ANDistributedFlowLayout *layout = [ANDistributedFlowLayout new];
layout.minimumInteritemSpacing = 10.f;
layout.minimumLineSpacing = 10.f;

[[UICollectionViewController alloc] initWithCollectionViewLayout:layout];

Swift:

let layout = ANDistributedFlowLayout()
layout.minimumInteritemSpacing = 10.0
layout.minimumLineSpacing = 10.0

UICollectionViewController(collectionViewLayout: layout)

Example

See the layout in use in the ./Example app: