• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 5 years ago

Reviews

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

Repository Details

Adds iMessage style timestamp support. Written in Swift!

Purpose

I recently needed to build the iMessage style pull-to-reveal timestamps feature for a personal project and decided to open source the implementation.

Installation

Simply add the following to your Podfile:

Latest release uses Swift 5: pod RevealableCell

If you need Swift 2.2: pod 'RevealableCell', '1.1'

If you need Swift 3.0: pod 'RevealableCell', '2.0'


Then add the following import at the top of your source file(s):

Swift import RevealableCell Obj-C @import RevealableCell

Usage

In order to use RevealableCell in your application, follow the steps below:

  1. Your cell must be a subclass of RevealableTableViewCell

  2. You must register a nib or a RevealableView subclass using:

    tableView.registerNib(nib, forRevealableViewReuseIdentifier: "identifier") or tableView.registerClass(revealableViewClass, forRevealableViewReuseIdentifier: "identifier")

  3. In cellForRowAtIndexPath you can dequeue and configure an instance using:

    if let view = tableView.dequeueReusableRevealableViewWithIdentifier("identifier") as? MyRevealableView {
      view.titleLabel.text = "" // configure
      cell.setRevealableView(view, style: .Slide, direction: .Left)
    }

This new implementation, provides reusable views of the same type as well as allowing you to have different styles or directions for individual cells.

Run this project, to see a demo similar to the iMessage app on your iOS device.

Additional Info

RevealableViews also support AutoLayout now, so if you've setup your constraints correctly, the views will auto-size their widths (per cell) for you. However, you can also specify a fixed width for each cell using

cell.revealableView.width = 100

Note: The height will always be the same as the cell and the position is based on the .style of the RevealableView

Feel free to use in any way you see fit. Please try and reference me somewhere in your app if you use this in a production app and maybe even tell me about it via Twitter @shaps ;)

Screenshot

Supported OS & SDK Versions

  • Supported build target - iOS 8.0
  • Earliest supported deployment target - iOS 8.0

More Repositories

1

Peek

All new design. Inspect your iOS application at runtime.
Swift
2,601
star
2

SwiftUIBackports

A collection of SwiftUI backports for iOS, macOS, tvOS and watchOS
Swift
940
star
3

InkKit

Drawing and Geometry made easy on iOS - now in Swift 3.0
Swift
373
star
4

MarkdownText

A native SwiftUI view for rendering Markdown text in an iOS or macOS app
Swift
142
star
5

GraphicsRenderer

A drop-in UIGraphicsRenderer port -- CrossPlatform, Swift 4, Image & PDF
Swift
109
star
6

Warrant

Data validation made easy. In code and from Interface Builder.
Swift
54
star
7

Stack

A Type-Safe, Thread-Safe-ish approach to CoreData in Swift
Swift
48
star
8

SwiftUIPlus

SwiftUI additions and helpers that are missing from the official implementation.
Swift
24
star
9

Color

A Swifty type-safe abstraction around color models
Objective-C
23
star
10

Feedback

Familiar, easy state-driven haptics, audio and more
Swift
22
star
11

ColumnView

A column-view navigation controller that behaves similarly to Files and Finder
Swift
21
star
12

Logging

Apple's SwiftLog + OSLog style StringInterpolation
Swift
16
star
13

Objective-C-Style-Guide

Objective-C Style Guide
15
star
14

SwiftUIBackportsDemo

A collection of Demo's for the SwiftUI Backports.
Swift
15
star
15

SwiftBackports

A collection of Swift backports for earlier versions of iOS, macOS, tvOS and watchOS
Swift
13
star
16

Abracadabra

A truly plug 'n' play solution for securing your code.
Objective-C
12
star
17

Snaply

Drop-in snapping behaviour for any scroll/collection/table/view using arbitrary points!
Swift
9
star
18

CornerMasking

SPXMasking is category on CALayer that allows you to specify different a corner radius for each corner of a CALayer.
Objective-C
8
star
19

MarkdownTextDemo

A demo app for showcasing the MarkdownText library.
Swift
7
star
20

SVGRenderer

An SVG renderer using the familiar GraphicsRenderer API.
Swift
6
star
21

ActivityView

Moved to SwiftUI-Plus/ActivityView
5
star
22

Storage

Moved to SwiftUI-Plus/DefaultStorage
5
star
23

Media

Moved to SwiftUI-Plus/Media
5
star
24

ghost-app-extract

Allows you to create better excerpt's in your Ghost blog posts.
JavaScript
4
star
25

AppManifest

Swift
4
star
26

SwiftLayout

A Swift library for programmatically dealing with AutoLayout
Swift
4
star
27

FlowLayout-Demo

A high-performance flow layout that provides global headers, footers, section backgrounds and various configurations.
Swift
4
star
28

Endpoints

A generic Swift networking library inspired by SwiftUI APIs
Swift
4
star
29

Analytics

Swift
3
star
30

PhotoLibrary

Photo library picker for iOS
Swift
2
star
31

primo

The first script to install a newly installed Mac! This will install common terminal utilities & applications.
Shell
2
star
32

Whos-Who

Who's Who sample code for job interview.
Objective-C
2
star
33

SPXLayout

AutoLayout the programmatic way
Objective-C
2
star
34

SPXSubscripting

This is a library for adding subscripting support to various Foundation classes. It also adds some interesting solutions to working with NSString's, NSAttributedString's and their attributes.
Objective-C
2
star
35

SPXDataSources

DataSource implementations for UITableView and UICollection, plus more...
Objective-C
2
star
36

Populate

Data providers for populating your data views.
Swift
2
star
37

bash

Various bash scripts I've written to simply my development and sometimes just to make me smile.
Shell
2
star
38

DownloadService

A Swift service for handling downloads and their associated resources.
Swift
1
star
39

SwiftHelpDemo

A demo project for showcasing SwiftHelp
Swift
1
star
40

SwiftHelp

A SwiftUI library for building interactive help systems in your apps
Swift
1
star
41

Development-Environment

All files, settings and configurations I use for my Development Environment's
1
star
42

FlowLayout

A high-performance flow layout that provides global headers, footers, section backgrounds and various configurations.
Swift
1
star
43

SPXCacheManager

A highly configurable and reusable library for handling caching in your iOS apps. Not only for images!!
Objective-C
1
star
44

SPXKeychain

My iOS Keychain Wrapper
Objective-C
1
star
45

PGTest-XCTest

Swift
1
star
46

ScaledMetric

A SwiftUI dynamic property wrapper (a back-port) that scales a numeric value. iOS, macOS, tvOS, watchOS
Swift
1
star
47

Snippex

My own personal library of reusable code that compiles and standardises some classes across iOS and OSX.
Objective-C
1
star
48

CellProvider

A generic cell provider implementation in Swift
Shell
1
star