{"id":15038557,"url":"https://github.com/sgr-ksmt/pulltodismiss","last_synced_at":"2025-04-05T08:08:51.406Z","repository":{"id":62451269,"uuid":"73672682","full_name":"sgr-ksmt/PullToDismiss","owner":"sgr-ksmt","description":"You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.","archived":false,"fork":false,"pushed_at":"2020-03-25T04:09:41.000Z","size":3399,"stargazers_count":487,"open_issues_count":14,"forks_count":54,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-05T08:08:45.881Z","etag":null,"topics":["animation","apple-swift","awesome-ios","awesome-swift","carthage","cocoapods","ios","swift","swift-extensions","swift-framework","swift-language","swift-library","ui"],"latest_commit_sha":null,"homepage":"","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/sgr-ksmt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"sgr-ksmt"}},"created_at":"2016-11-14T06:13:05.000Z","updated_at":"2024-11-28T22:46:59.000Z","dependencies_parsed_at":"2022-11-01T23:33:10.262Z","dependency_job_id":null,"html_url":"https://github.com/sgr-ksmt/PullToDismiss","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgr-ksmt%2FPullToDismiss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgr-ksmt%2FPullToDismiss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgr-ksmt%2FPullToDismiss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgr-ksmt%2FPullToDismiss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgr-ksmt","download_url":"https://codeload.github.com/sgr-ksmt/PullToDismiss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305935,"owners_count":20917208,"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":["animation","apple-swift","awesome-ios","awesome-swift","carthage","cocoapods","ios","swift","swift-extensions","swift-framework","swift-language","swift-library","ui"],"created_at":"2024-09-24T20:38:53.180Z","updated_at":"2025-04-05T08:08:51.386Z","avatar_url":"https://github.com/sgr-ksmt.png","language":"Swift","funding_links":["https://github.com/sponsors/sgr-ksmt"],"categories":[],"sub_categories":[],"readme":"# PullToDismiss\nPullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth and rich background effect.  \n\n[![GitHub release](https://img.shields.io/github/release/sgr-ksmt/PullToDismiss.svg)](https://github.com/sgr-ksmt/PullToDismiss/releases)\n![Language](https://img.shields.io/badge/language-Swift%205.0-orange.svg)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/badge/Cocoa%20Pods-✓-4BC51D.svg?style=flat)](https://cocoapods.org/pods/PullToDismiss)\n[![CocoaPodsDL](https://img.shields.io/cocoapods/dt/PullToDismiss.svg)](https://cocoapods.org/pods/PullToDismiss)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/matteocrippa/awesome-swift#ui)\n[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)\n\n\n\u003cbr /\u003e\n\n|            sample            |            blur sample            |\n| :--------------------------: | :-------------------------------: |\n| ![gif](Documents/sample.gif) | ![gif](Documents/blur_sample.gif) |\n\n\n- [Appetize.io Demo](https://appetize.io/app/hett44vca458r9artkbq0awxrc?device=iphone7\u0026scale=75\u0026orientation=portrait\u0026osVersion=10.0)\n\n## Feature\n- Support all scroll views. (UIScrollView, UITableView, UICollectionView, UIWebView, WKWebView)\n- Customizable. (dismiss background color, alpha, height percentage of dismiss)\n- Available in UIViewController, UINavigationController.\n- Automatically add pan gesture to navigation bar.\n- Blur effect support.\n- **Objective-C support.** (from *v2.1~*)\n\n### Migration guide\nIf you update from 1.x to 2.0, see [migration guide](Documents/PullToDismiss2MigrationGuide.md) if needed.\n\n## Usage\n### Getting Started\n(1) Setup `PullToDismiss`\n\n```swift\nimport PullToDismiss\n\nclass SampleViewController: UIViewController {\n    @IBOutlet private weak var tableView: UITableView!\n    private var pullToDismiss: PullToDismiss?\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        pullToDismiss = PullToDismiss(scrollView: tableView)\n    }\n}\n```\n\n(2) Create view controller and set `modalPresentationStyle`. Then present view controller\n\n```swift\nlet vc = SampleViewController()\nlet nav = UINavigationController(rootViewController: vc)\nnav.modalPresentationStyle = .overCurrentContext\n\nself.present(nav, animated: true, completion: nil)\n```\n\n\u003cbr /\u003e\n:thumbsup::thumbsup::thumbsup:\n\n### Use `(UIScrollView|UITableView|UICollectionView)Delegate`\n\nYou can use all scroll view's delegate by set `pullToDismiss.delegate`.\n\n```swift\nimport PullToDismiss\n\nclass SampleViewController: UIViewController {\n    @IBOutlet private weak var tableView: UITableView!\n    private var pullToDismiss: PullToDismiss?\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        pullToDismiss = PullToDismiss(scrollView: tableView)\n        pullToDismiss?.delegate = self\n    }\n}\n\nextension SampleViewController: UITableViewDelegate {\n    func scrollViewDidScroll(_ scrollView: UIScrollView) {\n        // ...\n    }\n\n    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {\n        // ...\n    }\n}\n```\n\n### Customize\nYou can customize backgroundEffect, dismissableHeightPercentage:\n\n#### Shadow background effet\n\n- background (default: `ShadowEffect.default`, [color: black, alpha: 0.8])\n\n![img1](Documents/img1.png)\n\n```swift\npullToDismiss?.background = ShadowEffect(color: .red, alpha: 0.5) // color: red, alpha: 0.5\n```\n\n#### Blur background effect\nNew feature for v1.0.\n\n![gif](Documents/blur_sample.gif)\n\n```swift\n// preset blur (.extraLight, .light, .dark)\npullToDismiss?.background = BlurEffect.extraLight\n\n// set custom Blur\npullToDismiss?.background = BlurEffect(color: .red, alpha: 0.5, blurRadius: 40.0, saturationDeltaFactor: 1.8)\n```\n\n#### dismissableHeightPercentage\n\n![img2](Documents/img2.png)\n\n\n```swift\n// to pull half size of view controller, dismiss view controller.\npullToDismiss?.dismissableHeightPercentage = 0.5\n```\n\n\n## Requirements\n- iOS 8.0+ (blur effect: iOS 9.0+)\n- Xcode 8.1+\n- Swift 3.0+\n\n## Installation\n\n### Carthage\n\n- Add the following to your *Cartfile*:\n\n```bash\n# Swift 5.0 or later\ngithub \"sgr-ksmt/PullToDismiss\" ~\u003e 2.2\n# Swift 3\ngithub \"sgr-ksmt/PullToDismiss\", 2.1\n```\n\n- Run `carthage update`\n- Add the framework as described.\n\u003cbr\u003e Details: [Carthage Readme](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application)\n\n\n### CocoaPods\n\n**PullToDismiss** is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\n# Swift 5.0 or later\npod 'PullToDismiss', '~\u003e 2.2'\n# Swift 3\npod 'PullToDismiss', '2.1'\n```\n\nand run `pod install`\n\n### Manually Install\nDownload all `*.swift` files and put your project.\n\n## Change log\nChange log is [here](https://github.com/sgr-ksmt/PullToDismiss/blob/master/CHANGELOG.md).\n\n## Communication\n- If you found a bug, open an issue.\n- If you have a feature request, open an issue.\n- If you want to contribute, submit a pull request.:muscle:\n\n## License\n\n**PullToDismiss** is under MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgr-ksmt%2Fpulltodismiss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgr-ksmt%2Fpulltodismiss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgr-ksmt%2Fpulltodismiss/lists"}