Skip to content

Instantly share code, notes, and snippets.

@dejanskledar
Created May 10, 2018 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dejanskledar/d1ab5e82016fa0840a075188477129d0 to your computer and use it in GitHub Desktop.
Save dejanskledar/d1ab5e82016fa0840a075188477129d0 to your computer and use it in GitHub Desktop.
This is a sample of a Centered CollectionView Flow Layout
class CollectionViewRow {
var attributes = [UICollectionViewLayoutAttributes]()
var spacing: CGFloat = 0
init(spacing: CGFloat) {
self.spacing = spacing
}
func add(attribute: UICollectionViewLayoutAttributes) {
attributes.append(attribute)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment