MIT License

项目介绍

lxcid/LXReorderableCollectionViewFlowLayout 是一个托管在 GitHub 上的开源项目,主要使用 Objective-C 编写,采用 MIT License 许可证,目前获得 1.8k 个 Star、297 次 Fork。

仓库全名
lxcid/LXReorderableCollectionViewFlowLayout
开源许可证
MIT License
Star 数
1.8k
Fork 数
297
未关闭 Issue
46

README 摘要

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,…

完整内容见 GitHub 原始 README 或本页 。

常见问题

LXReorderableCollectionViewFlowLayout 用什么语言开发?

主要使用 Objective-C 编写,采用 MIT License 许可证,目前有 1.8k 个 Star。

LXReorderableCollectionViewFlowLayout 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 LXReorderableCollectionViewFlowLayout 的源码?

可以直接克隆仓库:git clone https://github.com/lxcid/LXReorderableCollectionViewFlowLayout.git,默认分支为 master;安装与运行步骤见仓库 README。

LXReorderableCollectionViewFlowLayout 最近还在维护吗?

仓库最近一次更新为 2019年3月8日,当前有 46 个未关闭 Issue;Star 数为 1.8k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

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

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
2508
价值分
1199
活跃状态
活跃

语言占比

Objective-C
Ruby

README

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

Alternatives

License

LXReorderableCollectionViewFlowLayout is available under the MIT license.

评论

暂无评论