Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbruel committed Feb 1, 2016
1 parent 66fe984 commit a2c63bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ pod "ForceTouchable"
## Usage

To use ForceTouchable on your UIViewControllers all you have to do is implement the ForceTouchable protocol.
Most methods are already implemented in case your ForceTouchable implementation is a UIViewController, all you need to implement is `forceTouchPreviewForLocation(CGPoint)`.
Most methods are already implemented in case your ForceTouchable implementation is a UIViewController, all you need to implement is `forceTouchPreviewForLocation(CGPoint)` and call `setupForceTouch()` on your `viewDidAppear` method.

```swift
// MARK: ForceTouchable
extension ViewController: ForceTouchable {

override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
setupForceTouch()
}

func forceTouchPreviewForLocation(location: CGPoint) -> ForceTouchPreview? {
guard let indexPath = tableView.indexPathForRowAtPoint(location),
cell = tableView.cellForRowAtIndexPath(indexPath) else { return nil }
Expand Down

0 comments on commit a2c63bb

Please sign in to comment.