All Projects → kevin0571 → Stpopuppreview

kevin0571 / Stpopuppreview

Licence: mit
An alternative peek preview for non 3D Touch devices. Inspired by Instagram.

Projects that are alternatives of or similar to Stpopuppreview

Stpopup
STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.
Stars: ✭ 2,517 (+1146.04%)
Mutual labels:  iphone, ipad, ui-components, popup
Customized-Popup
Customized popup provides you independency related to how you want to show a popup according to your UX.
Stars: ✭ 13 (-93.56%)
Mutual labels:  iphone, ipad, popup
Canijailbreak.com
a website which tells you whether you can jailbreak your iOS device.
Stars: ✭ 112 (-44.55%)
Mutual labels:  iphone, ipad
A2hs.js
📲 A useful modern JavaScript solution that helps your website users to add (install) a progressive web application (PWA) to the Home Screen of their mobile iOS devices.
Stars: ✭ 113 (-44.06%)
Mutual labels:  iphone, ipad
Inappviewdebugger
A UIView debugger (like Reveal or Xcode) that can be embedded in an app for on-device view debugging
Stars: ✭ 1,805 (+793.56%)
Mutual labels:  iphone, ipad
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (-49.01%)
Mutual labels:  iphone, ipad
Colorify
Colorify - simple, yet powerful color library.
Stars: ✭ 106 (-47.52%)
Mutual labels:  iphone, ipad
Ioctocat
iOctocat v1 - GitHub for iOS (works on the iPhone, iPad, and iPod Touch)
Stars: ✭ 1,665 (+724.26%)
Mutual labels:  iphone, ipad
Spalert
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Stars: ✭ 1,014 (+401.98%)
Mutual labels:  ui-components, popup
Filesystem
FileSystem is an application that allows you to browse the content of your iPhone disk, displaying file and folders, files contents, and detailed informations about file and folder permissions.
Stars: ✭ 148 (-26.73%)
Mutual labels:  iphone, ipad
Apple Device Model List
All Apple devices model name list. 通过内部编号判断 iOS 设备型号。
Stars: ✭ 149 (-26.24%)
Mutual labels:  iphone, ipad
Alerttoast
Create Apple-like alerts & toasts using SwiftUI
Stars: ✭ 151 (-25.25%)
Mutual labels:  ui-components, popup
Jotify
Sticky notes reimagined - written in Swift
Stars: ✭ 79 (-60.89%)
Mutual labels:  iphone, ipad
Gmimagepicker.xamarin
Port of the original GMImagePicker component to Xamarin.iOS
Stars: ✭ 65 (-67.82%)
Mutual labels:  iphone, ipad
Device
Light weight tool for detecting the current device and screen size written in swift.
Stars: ✭ 1,503 (+644.06%)
Mutual labels:  iphone, ipad
Responsivedevices.css
Responsive CSS Device frames for your landing pages
Stars: ✭ 59 (-70.79%)
Mutual labels:  iphone, ipad
Appleapnpush
Send push notification to Apple Devices (iPhone, iPad)
Stars: ✭ 134 (-33.66%)
Mutual labels:  iphone, ipad
Clendar
Clendar - universal calendar app. Written in SwiftUI. Available on App Store
Stars: ✭ 153 (-24.26%)
Mutual labels:  iphone, ipad
Numericaltextentry
An iOS library for beautiful number entry fields. iPad friendly. Written in Swift.
Stars: ✭ 16 (-92.08%)
Mutual labels:  iphone, ipad
Otganttchartkit
OTGanttChartKit is gantt chart framework for iOS. This framework use easily like UITableView.
Stars: ✭ 38 (-81.19%)
Mutual labels:  iphone, ipad

STPopupPreview CI Status Version License

STPopupPreview uses long press gesture to enable quick preview of a page on non 3D Touch devices. Preview actions are also supported. This idea is inspired by Instagram.

It is built on top of of STPopup(a library provides STPopupController, which works just like UINavigationController in popup style). Both STPopup and STPopupPreview support iOS 7+.

Demo

STPopupPreviewDemo

Features

  • Long press to preview, release to dismiss.
  • Slide up to show preview actions.
  • Easy integration.

Get Started

CocoaPods

platform: ios, '7.0'
pod 'STPopupPreview'

Carthage

github "kevin0571/STPopupPreview"

*Don't forget to drag both STPopupPreview.framework and STPopup.framework into linked frameworks.

Usage

Import header file

#import <STPopupPreview/STPopupPreview.h>

Attach popup preview recognizer to view

CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([CollectionViewCell class]) forIndexPath:indexPath];
if (!cell.popupPreviewRecognizer) {
    cell.popupPreviewRecognizer = [[STPopupPreviewRecognizer alloc] initWithDelegate:self];
}

Implement STPopupPreviewRecognizerDelegate

Return the preview view controller. The preview view controller should have "contentSizeInPopup" set before its "viewDidLoad" called. More about this please read the document of STPopup.

- (UIViewController *)previewViewControllerForPopupPreviewRecognizer:(STPopupPreviewRecognizer *)popupPreviewRecognizer
{
    if (![popupPreviewRecognizer.view isKindOfClass:[CollectionViewCell class]]) {
        return nil;
    }
    
    CollectionViewCell *cell = popupPreviewRecognizer.view;
    
    PreviewViewController *previewViewController = [self.storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([PreviewViewController class])];
    previewViewController.data = cell.data;
    previewViewController.placeholderImage = cell.imageView.image;
    return previewViewController;
}

Return a view controller to present the preview view controller. Most of the time it will be the current view controller.

- (UIViewController *)presentingViewControllerForPopupPreviewRecognizer:(STPopupPreviewRecognizer *)popupPreviewRecognizer
{
    return self;
}

Return the preview actions you want to show when slides up. It can be nil if you don't have any preview actions.

- (NSArray<STPopupPreviewAction *> *)previewActionsForPopupPreviewRecognizer:(STPopupPreviewRecognizer *)popupPreviewRecognizer
{
    return @[ [STPopupPreviewAction actionWithTitle:@"Like" style:STPopupPreviewActionStyleDefault handler:^(STPopupPreviewAction *action, UIViewController *previewViewController) {
        // Action handler
    }] ];
}

Enable STPopupPreview only if 3D Touch is not available

BOOL isForceTouchAvailable = [self respondsToSelector:@selector(traitCollection)] &&
    [self.traitCollection respondsToSelector:@selector(forceTouchCapability)] &&
    self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable;
if (!isForceTouchAvailable) {
    if (!cell.popupPreviewRecognizer) {
        cell.popupPreviewRecognizer = [[STPopupPreviewRecognizer alloc] initWithDelegate:self];
    }
}

Issues & Contact

  • If you have any question regarding the usage, please refer to the example project for more details.
  • If you find any bug, please submit an issue.
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].