{"id":2374,"url":"https://github.com/andreamazz/BubbleTransition","last_synced_at":"2025-08-06T16:31:37.232Z","repository":{"id":31940809,"uuid":"35510454","full_name":"andreamazz/BubbleTransition","owner":"andreamazz","description":"A custom modal transition that presents and dismiss a controller with an expanding bubble effect.","archived":false,"fork":false,"pushed_at":"2020-11-04T15:29:03.000Z","size":512,"stargazers_count":3317,"open_issues_count":3,"forks_count":250,"subscribers_count":59,"default_branch":"master","last_synced_at":"2024-10-25T14:14:40.698Z","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/andreamazz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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":"andreamazz"}},"created_at":"2015-05-12T20:16:25.000Z","updated_at":"2024-10-23T12:46:09.000Z","dependencies_parsed_at":"2022-08-07T17:01:02.966Z","dependency_job_id":null,"html_url":"https://github.com/andreamazz/BubbleTransition","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FBubbleTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FBubbleTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FBubbleTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreamazz%2FBubbleTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreamazz","download_url":"https://codeload.github.com/andreamazz/BubbleTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227421036,"owners_count":17774997,"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:16:12.224Z","updated_at":"2024-12-09T16:31:07.003Z","avatar_url":"https://github.com/andreamazz.png","language":"Swift","funding_links":["https://github.com/sponsors/andreamazz","https://www.paypal.me/andreamazzini"],"categories":["UI","Libs","Animation","Swift","Content","UI [🔝](#readme)","Other","ALL"],"sub_categories":["Transition","UI","Layout","Other free courses","Mathematics"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"420\" height=\"240\" src=\"assets/logo.png\"/\u003e\n\u003c/p\u003e\n\n[![CocoaPods](https://cocoapod-badges.herokuapp.com/v/BubbleTransition/badge.svg)](http://cocoapods.org/?q=bubbletransition)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n![Swift 5.0](https://img.shields.io/badge/swift-5.0-orange.svg)\n[![codebeat badge](https://codebeat.co/badges/45635139-6294-4ac8-9f39-6f1d3b18dd23)](https://codebeat.co/projects/github-com-andreamazz-bubbletransition)\n\nA custom modal transition that presents and dismiss a controller inside an expanding and shrinking _bubble_.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://appetize.io/app/tck0418dftyfjxkqrfu34rwt44' alt='Live demo'\u003e\n    \u003cimg width=\"150\" height=\"75\" src=\"assets/demo-button.png\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Screenshot\n![BubbleTransition](https://raw.githubusercontent.com/andreamazz/BubbleTransition/master/assets/screenshot.gif)\n\n# Usage\nInstall through [CocoaPods](http://cocoapods.org):\n```\npod 'BubbleTransition', '~\u003e 3.2.0'\n\nuse_frameworks!\n```\nInstall through [Carthage](https://github.com/Carthage/Carthage):\n```\ngithub \"andreamazz/BubbleTransition\"\n```\n\nInstall through [Swift Package Manager](https://swift.org/package-manager/):\n\nTo integrate using Xcode:  \n\n`File` -\u003e `Swift Packages` -\u003e `Add Package Dependency...`  \n\nEnter package URL: `https://github.com/andreamazz/BubbleTransition`, and select the latest release. \n\n\n# Setup\nHave your view controller conform to `UIViewControllerTransitioningDelegate`. Set the `transitionMode`, the `startingPoint`, the `bubbleColor` and the `duration`.\n```swift\nlet transition = BubbleTransition()\n\npublic override func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n  let controller = segue.destination\n  controller.transitioningDelegate = self\n  controller.modalPresentationCapturesStatusBarAppearance = true\n  controller.modalPresentationStyle = .custom\n}\n\n// MARK: UIViewControllerTransitioningDelegate\n\npublic func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n  transition.transitionMode = .present\n  transition.startingPoint = someButton.center\n  transition.bubbleColor = someButton.backgroundColor!\n  return transition\n}\n\npublic func animationController(forDismissed dismissed: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n  transition.transitionMode = .dismiss\n  transition.startingPoint = someButton.center\n  transition.bubbleColor = someButton.backgroundColor!\n  return transition\n}\n```\n\nYou can find the Objective-C equivalent [here](https://gist.github.com/andreamazz/9b0d6c7db065555ec0d7).\n\n# Swipe to dismiss\n\nYou can use an interactive gesture to dismiss the presented controller. To enable this gesture, prepare the interactive transition:\n\n```swift\nlet interactiveTransition = BubbleInteractiveTransition()\n\noverride func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n  if let controller = segue.destination as? ModalViewController {\n    controller.transitioningDelegate = self\n    controller.modalPresentationStyle = .custom\n    controller.modalPresentationCapturesStatusBarAppearance = true\n    controller.interactiveTransition = interactiveTransition\n    interactiveTransition.attach(to: controller)\n  }\n}\n```\n\nand implement `interactionControllerForDismissal` in your presenting controller:\n\n```swift\nfunc interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -\u003e UIViewControllerInteractiveTransitioning? {\n  return interactiveTransition\n}\n```\n\nIn the presented controller make sure to call `finish()` on the interactive gesture if you need to quickly dismiss from a button press instead. Check the sample code for more info.  \n\nYou can decide the gesture threshold and the swipe direction:\n```swift\ninteractiveTransition.interactionThreshold = 0.5\ninteractionThreshold.swipeDirection = .up\n```\n\n# Properties\n```swift\nvar startingPoint = CGPointZero\n```\nThe point that originates the bubble.\n\n```swift\nvar duration = 0.5\n```\nThe transition duration.\n\n```swift\nvar transitionMode: BubbleTranisionMode = .present\n```\nThe transition direction. Either `.present`, `.dismiss` or `.pop`.\n\n```swift\nvar bubbleColor: UIColor = .white\n```\nThe color of the bubble. Make sure that it matches the destination controller's background color.  \n\nCheckout the sample project for the full implementation.\n\n# Author\n[Andrea Mazzini](https://twitter.com/theandreamazz). I'm available for freelance work, feel free to contact me.\n\nWant to support the development of [these free libraries](https://cocoapods.org/owners/734)? Buy me a coffee ☕️ via [Paypal](https://www.paypal.me/andreamazzini).  \n\n# Contributors\nThanks to [everyone](https://github.com/andreamazz/BubbleTransition/graphs/contributors) kind enough to submit a pull request.\n\n# MIT License\n\n\tCopyright (c) 2018-2020 Andrea Mazzini. All rights reserved.\n\n\tPermission is hereby granted, free of charge, to any person obtaining a\n\tcopy of this software and associated documentation files (the \"Software\"),\n\tto deal in the Software without restriction, including\n\twithout limitation the rights to use, copy, modify, merge, publish,\n\tdistribute, sublicense, and/or sell copies of the Software, and to\n\tpermit persons to whom the Software is furnished to do so, subject to\n\tthe following conditions:\n\n\tThe above copyright notice and this permission notice shall be included\n\tin all copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\tOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\tMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\tIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\tCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\tTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\tSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreamazz%2FBubbleTransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreamazz%2FBubbleTransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreamazz%2FBubbleTransition/lists"}