iOS UICollectionView Create a UICollectionView

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Initialize a UICollectionView with a CGRect frame:

Swift:

let collection = UICollectionView(frame: CGRect(x: 0, y: 0, width: 200, height: 21))

Objective C:

UICollectionView *collection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 200, 21)];

You can also create a UICollectionView in Interface Builder

enter image description here



Got any iOS Question?