custom collection view layouts - raywenderlich.com€¦ · swift generics, closures, enums, and...

Post on 29-Jun-2020

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Custom Collection View Layouts

Introduction

Architecture

UICollectionView

UICollectionViewLayout

UICollectionViewLayoutAttributesUICollectionViewLayoutAttributesUICollectionViewLayoutAttributesUICollectionViewLayoutAttributes

UICollectionViewFlowLayout

UICollectionViewCell

UICollectionReusableView

Key Methods

override func collectionViewContentSize() -> CGSize

override func prepareLayout()

override func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject]?

Parts 1-3: Pinterest

Subclass UICollectionViewLayout Dynamically Sized Cells Cache Layout Attributes Custom Cell Padding & Insets Custom Layout Attributes

Parts 4-6: DIY

Subclass UICollectionViewFlowLayout Manipulate Supplementary Views Custom Layout Attributes Auto Layout

Part 7: Sticky Headers

Subclass UICollectionViewFlowLayout Familiar UITableView Behaviour Self-contained Layout Override Two Methods

Parts 8-10: Ultravisual

Subclass UICollectionViewLayout Interactive Layout Manipulate Target Content Offset Update Interface Elements

Parts 11-13: Timbre

Subclass UICollectionViewFlowLayout Manipulate Cell Transform Parallax Effect Auto Layout View Clipping

Challenge Time!

top related