{"id":25420469,"url":"https://github.com/harshilshah/decktransition","last_synced_at":"2025-05-15T08:05:02.440Z","repository":{"id":12226998,"uuid":"71269236","full_name":"HarshilShah/DeckTransition","owner":"HarshilShah","description":"A library to recreate the iOS Apple Music now playing transition","archived":false,"fork":false,"pushed_at":"2022-05-17T16:17:11.000Z","size":2595,"stargazers_count":2188,"open_issues_count":23,"forks_count":167,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-04-07T02:19:30.583Z","etag":null,"topics":["apple-music","ios","modals","transition"],"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/HarshilShah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-10-18T16:37:55.000Z","updated_at":"2025-02-18T14:36:49.000Z","dependencies_parsed_at":"2022-11-28T10:34:24.924Z","dependency_job_id":null,"html_url":"https://github.com/HarshilShah/DeckTransition","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshilShah%2FDeckTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshilShah%2FDeckTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshilShah%2FDeckTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HarshilShah%2FDeckTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HarshilShah","download_url":"https://codeload.github.com/HarshilShah/DeckTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248869641,"owners_count":21174905,"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":["apple-music","ios","modals","transition"],"created_at":"2025-02-16T19:38:35.080Z","updated_at":"2025-04-14T11:23:59.330Z","avatar_url":"https://github.com/HarshilShah.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeckTransition\n\n[![CI Status](http://img.shields.io/travis/HarshilShah/DeckTransition.svg)](https://travis-ci.org/HarshilShah/DeckTransition)\n[![Version](https://img.shields.io/github/release/HarshilShah/DeckTransition.svg)](https://github.com/HarshilShah/DeckTransition/releases/latest)\n![Package Managers](https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage-orange.svg)\n[![Documentation](https://cdn.rawgit.com/HarshilShah/DeckTransition/master/docs/badge.svg)](https://harshilshah.github.com/DeckTransition)\n[![License](https://img.shields.io/badge/license-MIT-999999.svg)](https://github.com/HarshilShah/DeckTransition/blob/master/LICENSE)\n[![Contact](https://img.shields.io/badge/contact-%40HarshilShah1910-3a8fc1.svg)](https://twitter.com/HarshilShah1910)\n\nDeckTransition is an attempt to recreate the card-like transition found in the iOS 10 Apple Music and iMessage apps.\n\nHereʼs a GIF showing it in action.\n\n![Demo](https://raw.githubusercontent.com/HarshilShah/DeckTransition/master/Resources/demo.gif)\n\n## Requirements\n\n- Swift 5.0\n- iOS 9 or later\n\n## Installation\n\n### CocoaPods\n\nTo install DeckTransition using [CocoaPods](http://cocoapods.org), add the following line to your Podfile:\n\n```\npod 'DeckTransition', '~\u003e 2.0'\n```\n\n### Carthage\n\nTo install DeckTransition using [Carthage](https://github.com/Carthage/Carthage), add the following line to your Cartfile:\n\n```\ngithub \"HarshilShah/DeckTransition\" ~\u003e 2.0\n```\n\n## Documentation\n\nYou can find [the docs here](https://harshilshah.github.io/DeckTransition \"Documentation\"). Documentation is generated with [Jazzy](https://github.com/realm/jazzy), and hosted on [GitHub Pages](https://pages.github.com).\n\n## Usage\n\n### Basics\n\nSet `modalPresentationCapturesStatusBarAppearance` to `true` in your modal view controller, and override the `preferredStatusBarStyle` variable to return `.lightContent`.\n\nAdditionally, the `UIScrollView` instances which should be tracked for the swipe-to-dismiss gesture should have their `backgroundColor` set to `.clear`.\n\n### Presentation\n\nThe transition can be called from code or using a storyboard.\n\nTo use via storyboards, just setup a custom segue (`kind` set to `custom`), and set the `class` to `DeckSegue`.\n\nHereʼs a snippet showing usage via code. Just replace `ModalViewController()` with your view controller's class and youʼre good to go.\n\n```swift\nlet modal = ModalViewController()\nlet transitionDelegate = DeckTransitioningDelegate()\nmodal.transitioningDelegate = transitionDelegate\nmodal.modalPresentationStyle = .custom\npresent(modal, animated: true, completion: nil)\n```\n\n### Dismissal\n\nBy default, DeckTransition has a swipe-to-dismiss gesture which is automatically enabled when your modalʼs main `UIScrollView` is scrolled to the top.\n\nYou can opt-out of this behaviour by passing in `false` for the `isSwipeToDismissEnabled` parameter while initialising your `DeckTransitioningDelegate`.\n\n### `UIScrollView` detection\n\nDeckTransition has an internal heuristic to determine which `UIScrollView` should be tracked for the swipe-to-dismiss gesture. In general, this should be sufficient for and cover most use cases.\n\nHowever there are some edge cases, and should you run into one, these can we worked around by making your modal view controller conform to the `DeckTransitionViewControllerProtocol` protocol. More information about this can be found in the documentation page about [UIScrollView detection](https://harshilshah.github.io/DeckTransition/uiscrollview-detection.html).\n\n### Snapshots\n\nFor a variety of reasons, and especially because of iOS 11's safe area layout, DeckTransition uses a snapshot of your presenting view controller's view instead of using the view directly. This view is automatically updated whenever the frame is resized.\n\nHowever, there can be some cases where you might want to update the snapshot view by yourself, and this can be achieved using the following one line snippet:\n\n```swift\n(presentationController as? DeckSnapshotUpdater)?.requestPresentedViewSnapshotUpdate()\n```\n\nAll this does is request the presentation controller to update the snapshot.\n\nYou can also choose to update snapshot directly from the presenting view controller, as follows:\n\n```swift\n(presentedViewController?.presentationController as? DeckSnapshotUpdater)?.requestPresentedViewSnapshotUpdate()\n```\n\nIt's worth noting that updating the snapshot is an expensive process and should only be used if necessary, for example if you are updating your entire app's theme.\n\n## Apps Using DeckTransition\n- [Petty](https://zachsim.one/projects/petty) by [Zach Simone](https://twitter.com/zachsimone)\n- [Bitbook](https://bitbookapp.com) by [Sammy Gutierrez](https://sammygutierrez.com)\n- [What's Open for iOS](https://git.gmu.edu/srct/whats-open-ios) by [Mason SRCT](https://srct.gmu.edu/)\n- [Manabi Reader](https://reader.manabi.io) by [Alex Ehlke](https://twitter.com/aehlke)\n\nFeel free to submit a PR if you’re using this library in your apps\n\n## Author\n\nWritten by [Harshil Shah](https://twitter.com/HarshilShah1910)\n\n## License\n\nDeckTransition 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%2Fharshilshah%2Fdecktransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshilshah%2Fdecktransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshilshah%2Fdecktransition/lists"}