Skip to content

Commit

Permalink
Added auto-generated Documentation and changes to the Readme file.
Browse files Browse the repository at this point in the history
  • Loading branch information
sovata8 committed Aug 19, 2017
1 parent 29bee42 commit 511335a
Show file tree
Hide file tree
Showing 39 changed files with 4,226 additions and 16 deletions.
51 changes: 35 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis](https://img.shields.io/travis/sovata8/RevealingTableViewCell.svg)](https://travis-ci.org/sovata8/RevealingTableViewCell/)
[![Swift 3.0](https://img.shields.io/badge/Swift-3.0-FD7835.svg?style=flat)](https://swift.org/)
[![license MIT](https://img.shields.io/cocoapods/l/RevealingTableViewCell.svg)][linkMITLicence]
[![CocoaPods](https://img.shields.io/cocoapods/metrics/doc-percent/RevealingTableViewCell.svg)][linkDocumentation]
<a href="#documentation">![](https://img.shields.io/cocoapods/metrics/doc-percent/RevealingTableViewCell.svg)</a>
[![CocoaPods](https://img.shields.io/cocoapods/v/RevealingTableViewCell.svg)][linkPod]
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)][linkCarthage]

Expand All @@ -17,16 +17,19 @@
<a href="#installation">Installation</a>
&bull;
<a href="#usage">Usage</a>
&bull;
<a href="#documentation">Documentation</a>
</p>

#

## What is it?
RevealingTableViewCell is a UITableViewCell that can be swiped to reveal content underneath its main view.
It can be set up through Interface Builder, with no code changes.
(Note that it does not provide anything other than the sliding view - it's up to you to set up any views that need be revealed, e.g. buttons etc.)
`RevealingTableViewCell` is a `UITableViewCell` that can be swiped to reveal content underneath its main view.

* Zero-code setup: `RevealingTableViewCell` can be set up through Interface Builder, with no code changes.
* 'Bring your own views' - Note that `RevealingTableViewCell` does not provide anything other than the sliding view - it's up to you to set up any views that need be revealed, e.g. buttons etc.)

<br/>
<p align="center"><img src="Screenshots/RevealingCellScreenRecording10s.gif" /></p>


Expand All @@ -49,7 +52,7 @@ alt="Click to see an example" width="240" height="180" border="10" /></a>
(opens in YouTube)

## Installation
Requires: `Swift 3`, `iOS 10`
Requires min: `Swift 3`, `iOS 10`


#### [CocoaPods][linkPod] (recommended)
Expand Down Expand Up @@ -85,21 +88,26 @@ These screenshots show how to set up your views and IBOutlets:
Use `RevealingTableViewCell` (or your subclass of it) as a custom class for your tableview cell in Interface Builder.

### Step 2
Inside the cell's default `contentView`, put a subview and connect it to the the IBOutlet `uiView_mainContent`. This will be the view that slides sideways to reveal some content underneath. Using AutoLayout, pin this `uiView_mainContent` to it's superview using constraints:
Inside the cell's default `contentView`, put a subview and connect it to the the `IBOutlet` `uiView_mainContent`. This will be the view that slides sideways to reveal some content underneath. Using AutoLayout, pin this `uiView_mainContent` to it's superview (the `contentView`) using the following constraints:

`uiView_mainContent.centerX = superview.centerX`
`uiView_mainContent.width = superview.width`
`uiView_mainContent.height = superview.height`
`uiView_mainContent.centerY = superview.centerY`

```
uiView_mainContent.centerX = superview.centerX
uiView_mainContent.width = superview.width
uiView_mainContent.height = superview.height
uiView_mainContent.centerY = superview.centerY
```
(or instead of the `height` and `centerY` constraints, you can use `top` and `bottom` constraints)


### Step 3
Inside the cell's default `contentView`, put and connect `uiView_revealedContent_left` and/or `uiView_revealedContent_right` subviews. Pin them using AutoLayout to the corresponding sides of your cell. Fix their widths. Make sure they are behind the `uiView_mainContent`.

### Making the cells close when needed (optional)
### Step4
That's all - run your app!




### Making the cells close when needed <small>(optional)</small>
Usually, you would want cells to automatically close whenever you scroll the tableview, or when another cell is swiped sideways. To achieve this, use the provided tableview extension function `closeAllCells(exceptThisOne:)`. Here is an example (from the example project):

```swift
Expand All @@ -123,11 +131,22 @@ extension ViewController: RevealingTableViewCellDelegate
}
}
```
(of course when you are creating the cell in your `cellForRowAt indexPath` logic, don't forget to specify that `cell.revealingCellDelegate = self`)
(of course when you are creating the cell in your `cellForRowAt indexPath` logic, don't forget to set the delegate like this: `cell.revealingCellDelegate = self`)


## Documentation
Check out the auto-generated [Documentation](docs/Classes/RevealingTableViewCell.html).
(If you're reading this on GitHub, and the above link opens the html source, try [this](https://github.com/sovata8/RevealingTableViewCell/tree/master/docs/Classes/RevealingTableViewCell.html))

## Used by

<a href='https://pivotlistapp.com/' target="\_parent"><img src='Screenshots/app_icon_pivotlist.png' alt='Nozzle Logo' style='width:60px;'/></a>
<big>[PivotList](https://pivotlistapp.com/)</big>

Please let me know if you use `RevealingTableViewCell` in your app and would like to be mentioned here. (either email me or create e new issue with the "usedby" label)

## Known issues and considerations
* At the moment it is required that all the 'hidden' views (the ones that are behind the main view and are revealed when sliding), are in the view hierarchy of the cell at all times, even if they are never shown. This is obviously not great when performance matters.
## Known limitations and considerations
The way this library works requires that all the 'hidden' views (the ones that are behind the main view and are revealed when sliding), are in the view hierarchy of the cell at all times, even if they are never shown. This is obviously not great when performance matters.


[linkDocumentation]:http://cocoadocs.org/docsets/RevealingTableViewCell
Expand Down
Binary file added Screenshots/app_icon_pivotlist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 108 additions & 0 deletions docs/Classes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>

</head>
<body>
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">RevealingTableViewCell Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">RevealingTableViewCell Reference</a>
<img id="carat" src="img/carat.png" />
Classes Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/RevealingTableViewCell.html">RevealingTableViewCell</a>
</li>
<li class="nav-group-task">
<a href="Classes/RevealingTableViewCell/RevealingState.html">– RevealingState</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Extensions/UITableView.html">UITableView</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/RevealingTableViewCellDelegate.html">RevealingTableViewCellDelegate</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Classes</h1>
<p>The following classes are available globally.</p>

</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:C22RevealingTableViewCell22RevealingTableViewCell"></a>
<a name="//apple_ref/swift/Class/RevealingTableViewCell" class="dashAnchor"></a>
<a class="token" href="#/s:C22RevealingTableViewCell22RevealingTableViewCell">RevealingTableViewCell</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>A <code>UITableViewCell</code> subclass that can be swiped to reveal content udnerneath it’s main view</p>

<a href="Classes/RevealingTableViewCell.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">RevealingTableViewCell</span><span class="p">:</span> <span class="kt">UITableViewCell</span></code></pre>

</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2017 <a class="link" href="https://github.com/sovata8/RevealingTableViewCell" target="_blank" rel="external">Nikolay Suvandzhiev</a>. All rights reserved. (Last updated: 2017-08-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>

0 comments on commit 511335a

Please sign in to comment.