Skip to content

Build complex scrolling design using UICollectionView. POC.

Notifications You must be signed in to change notification settings

frouo/ios-dynamic-uicollectionview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrating how designing complex scrolling page UI can be easy.

It's like Lego® bricks:

  1. create your bricks, for exemple UserCollectionViewCell.swift + UserCollectionViewCell.xib
  2. reference your bricks in the Item enum

And that's it 😃

You are ready to build your design by assembling your own bricks.

Example:

class ViewController: UIViewController {
  @IBOutlet weak var collectionView: ItemCollectionView!

  // Here is your design:
  let items: [Item] = [
    .image(source: headerImageUrl),
    .user(profilePictureSource: userImageUrl, username: "John Doe"),
    .collection(items: [
      .user(profilePictureSource: user.father.imageUrl, username: "Korben Dallas"),
      .user(profilePictureSource: user.mother.imageUrl, username: "Lilou Dallas")
    ], scrollDirection: .horizontal),
    .text(user.bio),
    .image(source: footerImageUrl)
  ]

  override func viewDidLoad() {
    super.viewDidLoad()
    
    collectionView.items = items
  }
}

About

Build complex scrolling design using UICollectionView. POC.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages