GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lxcid/LXReorderableCollectionViewFlowLayout: Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.

BranchesTags
Open more actions menu

Latest commit

 

History

98 Commits
98 Commits

Folders and files

NameName
Last commit message
Last commit date
Content
Content
 
 
LXRCVFL Example using Storyboard
LXRCVFL Example using Storyboard
 
 
LXReorderableCollectionViewFlowLayout
LXReorderableCollectionViewFlowLayout
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
LXReorderableCollectionViewFlowLayout.podspec
LXReorderableCollectionViewFlowLayout.podspec
 
 
README.md
README.md
 
 

Repository files navigation

LXReorderableCollectionViewFlowLayout

Extends UICollectionViewFlowLayout to support reordering of cells. Similar to long press and pan on books in iBook.

Features

The goal of LXReorderableCollectionViewFlowLayout is to provides capability for reordering of cell, similar to iBook.

  • Long press on cell to invoke reordering capability.
  • When reordering capability is invoked, fade the selected cell from highlighted to normal state.
  • Drag around the selected cell to move it to the desired location, the other cells adjust accordingly. Callback in the form of delegate methods are invoked.
  • Drag selected cell to the edges, depending on scroll direction, scroll in the desired direction.
  • Release to stop reordering.

Getting Started

Screenshot

  1. Install using CocoaPods or drag the LXReorderableCollectionViewFlowLayout folder into your project.

  2. Initialize/Setup your collection view to use LXReorderableCollectionViewFlowLayout.

  3. The collection view controller that is to support reordering capability must conforms to LXReorderableCollectionViewDataSource protocol. For example,

    - (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath {
        id object = [mutableArray objectAtIndex:fromIndexPath.item];
        [mutableArray removeObjectAtIndex:fromIndexPath.item];
        [mutableArray insertObject:object atIndex:toIndexPath.item];
    }
    
  4. You can listen to some dragging events through comforming to LXReorderableCollectionViewDelegateFlowLayout methods.

  5. Setup your collection view accordingly to your need, run and see it in action! :D

Changes

Feb 24 2013 (Luke Scott)

  • Removed setUpGestureRecognizersOnCollectionView
  • Removed layout from delegate methods (can be accessed from collectionView)
  • Renamed delegate methods and split between dataSource and delegate
  • Added dataSource and delegate examples to sample project

Feb 23 2013 (Luke Scott)

  • Refactored everything to be more readable / maintainable
  • Deprecated setUpGestureRecognizersOnCollectionView - no longer necessary

Requirements

  • ARC
  • iOS 6 and above preferred
  • Xcode 4.5 and above

Credits

  • Originally created by Stan Chang Khin Boon (Github: @lxcid, Twitter: @lxcid, Google+: +Stan Chang Khin Boon) for buUuk, with reference to MaximilianL's implementation on Apple Developer Forums.
  • Refactored by Luke Scott, with some help from mulle-nat's fork.
  • Playing cards in the demo are downloaded from http://www.jfitz.com/cards/.

Alternatives

  • DraggableCollectionView by Luke Scott.

License

LXReorderableCollectionViewFlowLayout is available under the MIT license.

About

Extends `UICollectionViewFlowLayout` to support reordering of cells. Similar to long press and pan on books in iBook.

lxcid.com/

Topics

drag-and-dropibooksobjective-creorderinguicollectionviewuicollectionviewlayout

Resources

Readme
MIT license
Activity

Stars

1.8k stars

Watchers

72 watching

Forks

315 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.