{"id":1232,"url":"https://github.com/itsmeichigo/PeekView","last_synced_at":"2025-07-30T20:32:55.020Z","repository":{"id":56921387,"uuid":"51535694","full_name":"itsmeichigo/PeekView","owner":"itsmeichigo","description":"PeekView supports peek, pop and preview actions for iOS devices without 3D Touch capibility","archived":false,"fork":false,"pushed_at":"2019-06-03T15:50:15.000Z","size":868,"stargazers_count":122,"open_issues_count":1,"forks_count":26,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-08T09:24:05.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsmeichigo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-11T18:16:35.000Z","updated_at":"2023-09-13T14:33:29.000Z","dependencies_parsed_at":"2022-08-21T04:50:44.531Z","dependency_job_id":null,"html_url":"https://github.com/itsmeichigo/PeekView","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsmeichigo%2FPeekView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsmeichigo%2FPeekView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsmeichigo%2FPeekView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsmeichigo%2FPeekView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsmeichigo","download_url":"https://codeload.github.com/itsmeichigo/PeekView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228187605,"owners_count":17882335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:41.824Z","updated_at":"2024-12-04T20:31:09.550Z","avatar_url":"https://github.com/itsmeichigo.png","language":"Swift","funding_links":[],"categories":["Hardware"],"sub_categories":["Force Touch","Other free courses"],"readme":"# PeekView\nWhen implementing peek, pop and preview actions with 3D Touch, you may want to support such features for users accessing your app from older devices that don't provide 3D Touch capibility. PeekView hence can be used as an alternative in such case.\n\n![Preview](https://github.com/itsmeichigo/PeekView/blob/master/peekview.gif)\n![Screenshot](https://github.com/itsmeichigo/PeekView/blob/master/screenshot.png)\n\n(Please ignore the low resolution of the GIF. Try the demo for actual experience.)\n\n## Note\n\nThings that need improving\n- Better solution for Objective-C integration (the current is sort of hacky!)\n- Better documenting in code\n- Content view panned: Smoother animation\n- Action style: Selected functionality\n- More customizable UI if needed (requests are welcome)\n- Bug fixes if any\n\n## Requirements\n\n- iOS 8 and later\n- Swift 5 \u0026 Xcode 10.2\n- If you wish to work with Swift 2.3, check out branch `swift23`\n\n## Getting Started\n\n#### Install using CocoaPods\n\nJust add the following line in to your pod file:\n  \n\tpod 'PeekView'\n\n#### Manual Install\n\nDrag and drop folder named `Source` in your project and you're done.\n\n### Usage\n\n- Add `UILongPressGestureRecognizer` to the view you want to peek (i.e table view cell, image, hypertext, etc.)\n- Create a `UIViewController` instance as the content of your peek view; then set your desired frame for the content view. It's recommended to leave a 15px padding for both left and right margin of your content view.\n- If you want to include preview actions, prepare an array containing title of the buttons and its preview style. Don't forget to prepare completion handlers for when each button is tapped.\n\nSample snippet:\n\n```Swift\n  let options = [ \n    PeekViewAction(title: \"Option 1\", style: .Destructive), \n    PeekViewAction(title: \"Option 2\", style: .Default), \n    PeekViewAction(title: \"Option 3\", style: .Selected) ]\n  PeekView().viewForController(\n  parentViewController: self, \n  contentViewController: controller, \n  expectedContentViewFrame: frame, \n  fromGesture: gestureRecognizer, \n  shouldHideStatusBar: true, \n  withOptions: options, \n  completionHandler: { optionIndex in\n                    switch optionIndex {\n                    case 0:\n                        print(\"Option 1 selected\")\n                    case 1:\n                        print(\"Option 2 selected\")\n                    case 2:\n                        print(\"Option 3 selected\")\n                    default:\n                        break\n                    }\n                })\n```\n\nBe sure to check out the demo code for better understanding of the usage.\n\nAs for Objective-C integration, a slightly different static function should be used, in which the `menuOptions` array is expected to be an `NSArray` of `NSDictionary`'s. Please check the snippet below:\n\n```Objc\n\n    NSArray *options = @[@{@\"Option 1\": @(PeekViewActionStyleDefault)},\n                         @{@\"Option 2\": @(PeekViewActionStyleDestructive)}];\n    \n    UIViewController *contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@\"previewVC\"];\n    \n    [PeekView viewForControllerWithParentViewController:self\n                                  contentViewController:contentViewController\n                               expectedContentViewFrame:CGRectMake(0, 0, 280, 400)\n                                            fromGesture:gesture\n                                    shouldHideStatusBar:YES\n                                            withOptions:options\n                                      completionHandler:nil];\n```\n\n### ARC\n\nPeekView uses ARC. If you are using PeekView in a non-arc project, you\nwill need to set a `-fobjc-arc` compiler flag on every PeekView source files. To set a\ncompiler flag in Xcode, go to your active target and select the \"Build Phases\" tab. Then select\nPeekView source files, press Enter, insert -fobjc-arc and then \"Done\" to enable ARC\nfor PeekView.\n\n## Contributing\n\nContributions for bug fixing or improvements are welcome. Feel free to submit a pull request.\n\n## Licence\n\nPeekView is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsmeichigo%2FPeekView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsmeichigo%2FPeekView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsmeichigo%2FPeekView/lists"}