Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertherdzik/RHPreviewCell
I envied so much Spotify iOS app this great playlist preview cell π, I decided to create my own one πΆ. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user deviceπ₯.
https://github.com/robertherdzik/RHPreviewCell
demo spotify-ios uitableviewcell
Last synced: 3 months ago
JSON representation
I envied so much Spotify iOS app this great playlist preview cell π, I decided to create my own one πΆ. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user deviceπ₯.
- Host: GitHub
- URL: https://github.com/robertherdzik/RHPreviewCell
- Owner: robertherdzik
- License: mit
- Created: 2016-09-25T18:15:57.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-24T06:28:19.000Z (over 6 years ago)
- Last Synced: 2024-08-06T14:43:38.077Z (3 months ago)
- Topics: demo, spotify-ios, uitableviewcell
- Language: Swift
- Homepage:
- Size: 21.3 MB
- Stars: 385
- Watchers: 7
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - RHPreviewCell - I envied so much Spotify iOS app this great playlist preview cell. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". (UI / Table View / Collection View)
- awesome-ios-star - RHPreviewCell - I envied so much Spotify iOS app this great playlist preview cell. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". (UI / Table View / Collection View)
- awesome-ios - RHPreviewCell - I envied so much Spotify iOS app this great playlist preview cell, I decided to create my own one. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user device [β’](https://raw.githubusercontent.com/robertherdzik/RHPreviewCell/master/ReadmeAssets/demo.gif) (Content / Table View)
README
![](./ReadmeAssets/RHPreviewCellHeadLogo.gif)
[![Version](https://img.shields.io/cocoapods/v/RHPreviewCell.svg?style=flat)](http://cocoadocs.org/docsets/RHPreviewCell)
[![License](https://img.shields.io/cocoapods/l/BadgeSwift.svg?style=flat)](/LICENSE)
[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat)](https://developer.apple.com/iphone/index.action)
[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift)
[![Twitter](https://img.shields.io/twitter/follow/Roherdzik.svg?style=social&label=Follow)](https://twitter.com/Roherdzik)# RHPreviewCell πΆ
I envied so much Spotify iOS app this great playlist preview cell π, I decided to create my own one πΆ. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user deviceπ₯.## Play with it π
## Installation
You can install RHPreviewCell library using Cocoapods:
```
pod 'RHPreviewCell'
```
or you can simply copy ```RHPreviewCellSource``` folder to your project.## Usage
To fully integrate RHPreviewCell with your Table View you just need to use RHPreviewCell like normal UITableViewCell in terms of your TableView data source 'cellForRowAtIndexPath' method.```swift
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
// Fetching already registered RHPreviewTableViewCell
let cell = tableView.dequeueReusableCellWithIdentifier(reuseCellIdentifier) as! RHPreviewTableViewCell// Delegate using which, tiles will talk to your class
cell.delegate = self
// Data source for feed small tiles πΌ
cell.dataSource = selfreturn cell
}
```
π‘ Important thing is that your View Controller needs to comform to ``` RHPreviewCellDataSource``` and ``` RHPreviewCellDelegate``` protocols. In that way you will be able to provide all neccesary data for ``` RHPreviewTalveViewCell``` tiles.### RHPreviewCellDataSource
```swift
func previewCellNumberOfTiles(cell: RHPreviewTableViewCell) -> Int
func previewCell(cell: RHPreviewTableViewCell, tileForIndex: Int) -> RHPreviewTileView
```### RHPreviewCellDelegate
```swift
func previewCell(cell: RHPreviewTableViewCell, didSelectTileAtIndex indexValue: RHTappedTileIndexValue)
```
And thats it! π₯ You have already integrete Library with your Table View π## Implementation hint from me
### [Q] How may look like tiles communiacation with my classβπ€
As I said using ``` RHPreviewCellDelegate``` . I will show you how to handle it for particular cell:```swift
func previewCell(cell: RHPreviewTableViewCell, didSelectTileAtIndex indexValue: RHTappedTileIndexValue) {
let cellIndex = tableView.indexPathForCell(cell)!.rowswitch indexValue {
case .TileTapped(let index):
print("π² \(index) has been selected")
case .FingerReleased:
print("ππ½ Finger has been released (non of tiles has been tapped)")
}
}
```... as you can see delegate method as a argument takes ``` RHTappedTileIndexValue``` , yup... it is swift enum using which you will gather information about tapped tile (```.TileTapped(let index)``` ) or even whether user released his finger out of tiles area (```.FingerReleased``` ).
## Swift support
| Library ver| Swift ver|
| ------------- |:-------------:|
| 1.0.1 | 2.2 |
| 1.0.2 | 2.3 |
| 1.0.3 | 3.0 |
| 1.1.0 | 4.0 |## Check the Demo project
Please check out the demo project, you can see there how Library has been implemented in details.