Skip to content

Examples for Fairly complex custom collection view layouts

Notifications You must be signed in to change notification settings

MagdyZamel/MSZCollectionViewLayouts

Repository files navigation

MSZCollectionViewLayouts Tweet

Xcode 11.0 Swift 5.0 iOS 13

MSZ Custom Layouts examples for CollectionViewLayout.

Note: The project requires Xcode 11, Swift 5 and iOS 13.

Table of Demos

Random Item Size Using Delegate

  • Each item in the collection view is generated with a random size using UICollectionViewDelegateFlowLayout

Note: Code is available - On master Branch

Custom Horizontal Flow Layout

  • Each item is scaled based on how far it is to the center of the collection view relative to the x-axis

Note: Code is available On master Branch

Custom Vertical Flow Layout

  • Each item is scaled based on how far it is to the center of the collection view relative to the y-axis

Note: Code is availableOn master Branch

Dynamic Gallery Layout

  • Dynamic Gallery Layout where each item takes up enough space to fit its content
  • No spacing Fragments between items

Note: Code is available On master Branch

Transition between Layouts

  • Transitions between Dynamic Gallery Layout and FlowLayout

Note: Code is available On master Branch

One item per row

  • One item per row in the collection view implemented using subclassing UICollectionViewFlowLayout

Note: Code is available On landscapePortraitDemo Branch

Two items per row in landscape

  • One item per row in portrait mode and two item per row in landscape mode implemented using subclassing UICollectionViewFlowLayout

Note: Code is available On landscapePortraitDemo Branch