https://github.com/cemolcay/continuestouchcollectionview
A collection view subview for handling multiple continues touches on cells.
https://github.com/cemolcay/continuestouchcollectionview
continues-gesture ios multi-touch multitouch swift uicollectionview
Last synced: about 1 year ago
JSON representation
A collection view subview for handling multiple continues touches on cells.
- Host: GitHub
- URL: https://github.com/cemolcay/continuestouchcollectionview
- Owner: cemolcay
- License: mit
- Created: 2018-10-01T12:32:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-08T10:18:43.000Z (over 6 years ago)
- Last Synced: 2025-04-06T10:53:23.339Z (about 1 year ago)
- Topics: continues-gesture, ios, multi-touch, multitouch, swift, uicollectionview
- Language: Swift
- Homepage:
- Size: 1.05 MB
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ContinuesTouchCollectionView
====
A collection view subview for handling multiple continues touches on cells.
Demo
----

Install
----
``` ruby
pod 'ContinuesTouchCollectionView'
```
Requirements
----
* Swift 4.2+
* iOS 9.0+
Usage
----
* Create a `ContinuesTouchCollectionView` instance and populate `ContinuesTouchCollectionViewCell`s 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.
``` swift
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.
``` swift
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](https://itunes.apple.com/us/app/scalebud-auv3-midi-keyboard/id1409125865?ls=1&mt=8) (iOS, AUv3) in the app store, check it out!