Skip to content

Demo project showing a technique for building a reorderable `UICollectionView` using compositional layout and other stock UIKit APIs.

License

Notifications You must be signed in to change notification settings

briancoyner/interactive-grid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building An Interactive Grid View With UIKit

Goals

This demo shows a few techniques on how to build a re-ordable grid view based on stock UICollectionView API.

Here are the main UIKit APIs used by this demo:

  • UICollectionViews compositional layout API.
  • UICollectionViewDiffableDataSource and its reordering support.
  • UIContextMenuConfiguration for presenting optional menus from each displayed cell.

The view is driven by a two-column layout that supports two cell sizes:

  • Compact (half width)
  • Regular (full width)

Other goals

  • The layout must dynamically adjust while the user drags cells arounds.
  • The user must be able to long-press on cell to present a standard iOS context menu.

Additional details can be found in this blog post.

About

Demo project showing a technique for building a reorderable `UICollectionView` using compositional layout and other stock UIKit APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages