• Stars
    star
    1,481
  • Rank 31,732 (Top 0.7 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The custom collectionView layout that can perform reordering of cells by dragging it.

RACollectionViewReorderableTripletLayout

The custom collectionView layout that can perform reordering of cells by dragging it.

I created a new awesome UICollectionView reorderable layout !

Check it out !!

Features

  • Reorder cells by long pressing and dragging it !
  • You can Receive notification to some dragging events.
  • Sorry, has not supported horizontal scroll collection view.
  • Sections two or more are also not supported... Supported !

Please, send me pull request !

Screen shots

screen shot1 screen shot2

Animation

animated gif

Installation

RACollectionViewReorderableTripletLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RACollectionViewReorderableTripletLayout"

Usage

Add RACollectionViewReorderableTripletLayout to your collection view, then set delegate and datasource.

self.collectionView.delegate = self;
self.collectionView.dataSource = self;

Delegates and Datasource

TripletLayout

- (CGSize)collectionView:(UICollectionView *)collectionView sizeForLargeItemsInSection:(NSInteger)section; //Default to automaticaly grow square !
- (UIEdgeInsets)insetsForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)sectionSpacingForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)minimumInteritemSpacingForCollectionView:(UICollectionView *)collectionView;
- (CGFloat)minimumLineSpacingForCollectionView:(UICollectionView *)collectionView;

ReorderableTripletLayout

- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath;
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath didMoveToIndexPath:(NSIndexPath *)toIndexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath canMoveToIndexPath:(NSIndexPath *)toIndexPath;
- (CGFloat)reorderingItemAlpha:(UICollectionView * )collectionview; //Default 0.
- (UIEdgeInsets)autoScrollTrigerEdgeInsets:(UICollectionView *)collectionView; //Sorry, has not supported horizontal scroll.
- (UIEdgeInsets)autoScrollTrigerPadding:(UICollectionView *)collectionView;

- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;

License

RACollectionViewReorderableTripletLayout is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

DifferenceKit

๐Ÿ’ป A fast and flexible O(n) difference algorithm framework for Swift collection.
Swift
3,421
star
2

Former

Former is a fully customizable Swift library for easy creating UITableView based form.
Swift
1,307
star
3

Carbon

๐Ÿšด A declarative library for building component-based user interfaces in UITableView and UICollectionView.
Swift
1,291
star
4

RAReorderableLayout

A UICollectionView layout whitch can move item with drag and drop.
Swift
867
star
5

DiffableDataSources

๐Ÿ’พ A library for backporting UITableView/UICollectionViewDiffableDataSource.
Swift
836
star
6

swiftui-hooks

๐Ÿช A SwiftUI implementation of React Hooks. Enhances reusability of stateful logic and gives state and lifecycle to function view.
Swift
479
star
7

SwiftUI-Combine

This is an example project of SwiftUI and Combine using GitHub API.
Swift
452
star
8

VueFlux

โ™ป๏ธ Unidirectional State Management Architecture for Swift - Inspired by Vuex and Flux
Swift
331
star
9

PathDynamicModal

A modal view using UIDynamicAnimator, like the Path for iOS.
Swift
286
star
10

swiftui-atom-properties

โš›๏ธ Atomic approach state management and dependency injection for SwiftUI
Swift
232
star
11

FloatingActionSheetController

FloatingActionSheetController is a cool design ActionSheetController library written in Swift2.
Swift
140
star
12

DelegateProxy

Proxy for receive delegate events more practically
Swift
129
star
13

RASlideInViewController

RASlideInViewController has an transition effect expressing the depth, and you can dismiss it by draging
Objective-C
127
star
14

Alembic

โš—๏ธ Functional JSON Parser - Linux Ready ๐Ÿง
Swift
116
star
15

swift-mod

A tool for Swift code modification intermediating between code generation and formatting.
Swift
101
star
16

SwiftUI-Flux

๐Ÿš€ This is a tiny experimental application using SwiftUI with Flux architecture.
Swift
54
star
17

monkey-lang-swift

The Monkey Programming Language written in Swift -- Writing An Interpreter In Go
Swift
17
star
18

LiveStreamingApp

A sample app repository that broadcasting and player of HLS for iOS.
Swift
16
star
19

KenBurnsSlideshowView

Slideshow with Ken Burns effect for iOS.
Swift
11
star
20

VueFluxExample-GitHub

VueFlux VueFluxReactive example project
Swift
8
star
21

OwnKit

My own utility toolkit for ios
Swift
7
star
22

ra1028

2
star
23

Dribbble_client_sample

Swift
1
star