Create a UICollectionView
suggest changeInitialize a UICollectionView with a CGRect frame:
Swift:
let layout = UICollectionViewFlowLayout()
let collection = UICollectionView(frame: CGRect(x: 0, y: 0, width: 200, height: 21), collectionViewLayout: layout)
UICollectionView must be created with a non-nil layout. init(frame:) alone raises an exception.
Objective-C:
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
UICollectionView *collection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 200, 21) collectionViewLayout:layout];
You can also create a UICollectionView in Interface Builder
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents