All Projects → justeat → JustPeek

justeat / JustPeek

Licence: Apache-2.0 license
JustPeek is an iOS Library that adds support for Force Touch-like Peek and Pop interactions on devices that do not natively support this kind of interaction.

Programming Languages

shell
77523 projects
swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to JustPeek

setup-linux-debian
Installs essential JavaScript development programs.
Stars: ✭ 16 (-76.47%)
Mutual labels:  peek
php-peek-lock
A wrapper around flock()
Stars: ✭ 18 (-73.53%)
Mutual labels:  peek
json-peek
Stringify JSON *just enough* to see what it is
Stars: ✭ 33 (-51.47%)
Mutual labels:  peek
Peek
All new design. Inspect your iOS application at runtime.
Stars: ✭ 2,594 (+3714.71%)
Mutual labels:  peek
Peek
Take a peek into your Rails applications.
Stars: ✭ 3,153 (+4536.76%)
Mutual labels:  peek
peek-pg
Take a peek into the Postgres queries made during your application's requests.
Stars: ✭ 15 (-77.94%)
Mutual labels:  peek
Pressure
👇💥 JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
Stars: ✭ 2,785 (+3995.59%)
Mutual labels:  force-touch

JustPeek Banner

JustPeek

Version License Platform

Warning: This library is not supported anymore by Just Eat.

JustPeek is an iOS Library that adds support for Force Touch-like Peek and Pop interactions on devices that do not natively support this kind of interaction. Under the hood it uses the native implementation if available, otherwise a custom implementation based on UILongPressGestureRecognizer.

JustPeek Demo

Usage

Swift 3.2 = Version 0.3.1

Swift 4 = Version 1.0.0

// In a UITableViewController

import JustPeek

...

var peekController: PeekController?

// MARK: View Lifecycle

override func viewDidLoad() {
    super.viewDidLoad()
    peekController = PeekController()
    peekController?.register(viewController: self, forPeekingWithDelegate: self, sourceView: tableView)
}

// MARK: PeekingDelegate

func peekContext(_ context: PeekContext, viewControllerForPeekingAt location: CGPoint) -> UIViewController? {
    let viewController = storyboard?.instantiateViewController(withIdentifier: "ViewController")
    if let viewController = viewController, let indexPath = tableView.indexPathForRow(at: location) {
        configureViewController(viewController, withItemAtIndexPath: indexPath)
        if let cell = tableView.cellForRow(at: indexPath) {
            context.sourceRect = cell.frame
        }
        return viewController
    }
    return nil
}

func peekContext(_ context: PeekContext, commit viewController: UIViewController) {
    show(viewController, sender: self)
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

JustPeek is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JustPeek"

License

JustPeek is available under the Apache License, Version 2.0. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].