syxc / DynamicCell

A sample app demonstrate how to creating a UICollectionViewCell to have a dynamic height based on font size and image aspect ratio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DynamicCell

How to implement a dynamic height UICollectionViewCell in Swift.

This tutorial has two parts. First, We're going to implement a self-sizing UICollectionViewCell based on font size as shown in the screenshot on the left side. Second, we're going to build a dynamic height UICollectionViewCell based on the image aspect ratio in addition to font size the result will be like the right side of the screenshot.

113447990-9d4fd680-9403-11eb-8e2a-2852a6af3656

Tutorial

The Article on Meduim

Prerequisites

  • Swift 5.3
  • Xcode
  • CocoaPods

Technology used

  • Xcode
  • Swift 5.3

How to use ?

  1. Download or clone the repository.
  2. Open the project through Xcode.
  3. Run the application in mobile or simulator running iOS 13

Credits

© Mohannad BakBouk | 2021

About

A sample app demonstrate how to creating a UICollectionViewCell to have a dynamic height based on font size and image aspect ratio


Languages

Language:Swift 98.6%Language:Ruby 1.4%