Latest 0.0.1
Homepage https://github.com/cemolcay/ContinuesTouchCollectionView
License MIT
Platforms ios 9.0, requires ARC
Authors

A collection view subview for handling multiple continues touches on cells.

Demo

alt tag

Install

pod 'ContinuesTouchCollectionView'

Requirements

  • Swift 4.2+
  • iOS 9.0+

Usage

  • Create a ContinuesTouchCollectionView instance and populate ContinuesTouchCollectionViewCells on it.
  • You can set isLocked property to true for disabling the scrolling on collection view and enabling multiple continues touches.
  • When you are populating your cells, set ContinuesTouchCollectionViewCellDelegate of the cell, to the view controller you are working on.
  • Get informed when your cells started or stopped being touched with the delegate methods.
public protocol ContinuesTouchCollectionViewCellDelegate: class {
  func continuesTouchCollectionViewCellDidStartTouching(_ cell: ContinuesTouchCollectionViewCell)
  func continuesTouchCollectionViewCellDidStopTouching(_ cell: ContinuesTouchCollectionViewCell)
}
  • You may also override isTouching property inside your cell class in order to make it responding highlight colors.
  • Use isTouching instead of isHihglighed property.
override var isTouching: Bool {
  didSet {
    backgroundColor = isTouching ? .lightGray : .darkGray
  }
}
  • Check out the example project for the implementation.

AppStore

This library is used in my app ScaleBud (iOS, AUv3) in the app store, check it out!

Latest podspec

{
    "name": "ContinuesTouchCollectionView",
    "version": "0.0.1",
    "summary": "A collection view subview for handling multiple touch on cells.",
    "description": "ContinuesTouchCollectionViewn====nnA collection view subview for handling multiple touch on cells.nnDemon----nn![alt tag](https://github.com/cemolcay/ContinuesTouchCollectionView/raw/master/Demo.gif)nnnInstalln----nn``` rubynpod 'ContinuesTouchCollectionView'n```nnRequirementsn----nn* Swift 4.2+n* iOS 9.0+nnnUsagen----nn* Create a `ContinuesTouchCollectionView` instance and populate `ContinuesTouchCollectionViewCell`s on it.n* You can set `isLocked` property to true for disabling the scrolling on collection view and enabling multiple touches.n* When you are populating your cells, set `ContinuesTouchCollectionViewCellDelegate` to the view controller you are working on.n* Get informed when your cells started or stopped being touched with the delegate methods.nn``` swiftnpublic protocol ContinuesTouchCollectionViewCellDelegate: class {nfunc continuesTouchCollectionViewCellDidStartTouching(_ continuesToucCollectionViewCell: ContinuesTouchCollectionViewCell)nfunc continuesTouchCollectionViewCellDidStopTouching(_ continuesToucCollectionViewCell: ContinuesTouchCollectionViewCell)n}n```nn* You may also override `isTouching` property inside your cell class in order to make it responding highlight colors.n* Use `isTouching` instead of `isHihglighed` property.nn``` swiftnoverride var isTouching: Bool {ndidSet {nbackgroundColor = isTouching ? .lightGray : .darkGrayn}n}n```nn* Check out the example project for the implementation.nnAppStoren----nnThis library is used in my app [ScaleBud](https://itunes.apple.com/us/app/scalebud-auv3-midi-keyboard/id1409125865?ls=1&mt=8) (iOS, AUv3) in the app store, check it out!",
    "homepage": "https://github.com/cemolcay/ContinuesTouchCollectionView",
    "license": "MIT",
    "authors": {
        "cemolcay": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/cemolcay/ContinuesTouchCollectionView.git",
        "tag": "0.0.1"
    },
    "source_files": "ContinuesTouchCollectionView/ContinuesTouchCollectionView.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This