• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 6 years ago

Reviews

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

Repository Details

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๐Ÿ’ฅ.

Version License Platform Language Twitter

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.

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 = self

    return 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

func previewCellNumberOfTiles(cell: RHPreviewTableViewCell) -> Int
func previewCell(cell: RHPreviewTableViewCell, tileForIndex: Int) -> RHPreviewTileView

RHPreviewCellDelegate

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:

func previewCell(cell: RHPreviewTableViewCell, didSelectTileAtIndex indexValue: RHTappedTileIndexValue) {
    let cellIndex = tableView.indexPathForCell(cell)!.row

    switch 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.

More Repositories

1

RHPlaceholder

Show pleasant loading view for your users ๐Ÿ˜
Makefile
237
star
2

RHSideButtons

Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. ๐ŸŒถ
Swift
168
star
3

SkrybaMD

Swifty powered ๐Ÿ”ŒMarkdown Documentation generator. If your team need easy way to maintain and create documentation, this generator is for you.
Swift
18
star
4

Instasoup

#SwiftUI mirroring of Instagram app Home screen
Swift
12
star
5

RHSwipeableCell

RHSwipeableCell gives you simple and cool looking custom cell with extra button after swipe action.
Swift
4
star
6

RHPlaygroundFreestyle

Sometimes I try to draw something in Playground, and if I decide whether it should be kept for the future usage, I will put this piece of .playground code in this repo ๐Ÿฐ
Swift
3
star
7

BitBayJS_terminal

Because life is way easier if you can check your currencies on BitBay through terminal... ๐Ÿ™ƒ
JavaScript
3
star
8

RHAnalogClock

Clock - my very old project, I'm afraid that he will be no longer developed. ๐Ÿ˜”
Objective-C
2
star
9

RHLifoOperationQueue

Simple implementation of LIFO algorithm for NSOperationQueue
Swift
1
star
10

Language

Because for english learning purposes most of the times I create .xlsx file with words to learn, I have created for myself small script for training words randomly fetched from .xlsx file. ๐Ÿ“–
Ruby
1
star
11

XcodeTheme-Rapha.cc

You are Road Cycling lover? โค๏ธhere you have: Xcode theme inspired by Rapha.cc ๐Ÿšดโ€โ™€๏ธcolors
1
star
12

wallapopNotifier

Because you don't have opportunity to `subscribe` for particular search and receiving notification in wallapop.es website or mobile app, I created quite simple mechanism to getting those according to defined keywords/filters.
1
star