Latest 0.1.8
Homepage https://github.com/dragonetail/SwipeSelectingCollectionView2
License Apache License 2.0
Platforms ios 9.0
Authors

A collection view subclass that enables swipe(finger over) to select multiple cells just like in Photos app.
This project is derived from SwipeSelectingCollectionView(https://github.com/ShaneQi/SwipeSelectingCollectionView)

Swift Version
Swift Version

Requirements

  • Swift 4.2
  • iOS 9.0+
  • Xcode 10.1

Installation

CocoaPods

You can use CocoaPods to install SwipeSelectingCollectionView by adding it to your Podfile:

platform :ios, '11.0'
use_frameworks!
pod 'SwipeSelectingCollectionView2'

To get the full benefits import SwipeSelectingCollectionView2 wherever you import UIKit

import UIKit
import SwipeSelectingCollectionView2

Manually

  1. Download and drop SwipeSelectingCollectionView.xcodeproj in your project.
  2. Congratulations!

Usage example

Programmatically

import SwipeSelectingCollectionView2

let collectionView = SwipeSelectingCollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) 

Added SwipeUICollectionViewDelegate

Delegate when the tap event recognized. If the cell was seleced, deselect the cell item and trigger the delegation didDeselectItemAt, otherwise just trigger the didSelectItemAtByTapped in SwipeUICollectionViewDelegate like blow.

import SwipeSelectingCollectionView2

extension ViewController: SwipeUICollectionViewDelegate {
    func collectionView(_ collectionView: UICollectionView, didSelectItemAtByTapped indexPath: IndexPath) {
        print("didSelectItemAtByTapped: (indexPath)")
        collectionView.selectItem(at: indexPath, animated: false, scrollPosition: [])
    }
}

Interface Builder

Contribute

We would love you for the contribution to SwipeSelectingCollectionView, check the LICENSE file for more info.

Meta

Original Auther:

Shane Qi – @shadowqi – [email protected]

Updated by:

dragonetail – [email protected]

Distributed under the Apache License 2.0. See LICENSE for more information.

https://github.com/shaneqi/SwipeSelectingCollectionView2

Latest podspec

{
    "name": "SwipeSelectingCollectionView2",
    "version": "0.1.8",
    "summary": "A collection view subclass that enables swipe(finger over) to select multiple cells just like in Photos app.",
    "description": "This collection view subclass is capable of selecting multiple cells with swipe just finger over cells.nInspired by Photos app in iOS 9+, derived from SwipeSelectingCollectionView(https://github.com/ShaneQi/SwipeSelectingCollectionView).",
    "homepage": "https://github.com/dragonetail/SwipeSelectingCollectionView2",
    "license": "Apache License 2.0",
    "authors": {
        "dragonetail": "[email protected]"
    },
    "social_media_url": "http://dragonetail.github.io/",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/dragonetail/SwipeSelectingCollectionView2.git",
        "tag": "0.1.8"
    },
    "source_files": "Sources"
}

Pin It on Pinterest

Share This