{"id":2375,"url":"https://github.com/naoyashiga/RPModalGestureTransition","last_synced_at":"2025-08-02T23:33:15.781Z","repository":{"id":150673413,"uuid":"43299704","full_name":"naoyashiga/RPModalGestureTransition","owner":"naoyashiga","description":"You can dismiss modal by using gesture :point_up_2: :iphone:","archived":false,"fork":false,"pushed_at":"2016-10-19T22:12:54.000Z","size":488,"stargazers_count":91,"open_issues_count":3,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-16T03:33:05.404Z","etag":null,"topics":["ios-animation"],"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/naoyashiga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-09-28T12:32:09.000Z","updated_at":"2024-04-19T01:34:57.000Z","dependencies_parsed_at":"2023-04-13T00:03:24.932Z","dependency_job_id":null,"html_url":"https://github.com/naoyashiga/RPModalGestureTransition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoyashiga%2FRPModalGestureTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoyashiga%2FRPModalGestureTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoyashiga%2FRPModalGestureTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoyashiga%2FRPModalGestureTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naoyashiga","download_url":"https://codeload.github.com/naoyashiga/RPModalGestureTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503195,"owners_count":17930534,"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":["ios-animation"],"created_at":"2024-01-05T20:16:12.246Z","updated_at":"2024-12-06T17:31:02.166Z","avatar_url":"https://github.com/naoyashiga.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Transition","Layout","Other free courses"],"readme":"# RPModalGestureTransition\n![](https://raw.githubusercontent.com/naoyashiga/RPModalGestureTransition/master/demo.gif)  \nYou can dismiss modal by using gesture.\n\n# Usage\n## 1.Define animation\nYou define animator class inherits UIViewControllerAnimatedTransitioning. I made this in [TransitionAnimator.swift](https://github.com/naoyashiga/RPModalGestureTransition/blob/master/RPModalGestureTransition/TransitionAnimator.swift).\n\n## 2.Set UIViewControllerTransitioningDelegate to modal\n```swift\nimport UIKit\n\nextension ModalViewController: UIViewControllerTransitioningDelegate {\n\n    func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -\u003e UIPresentationController? {\n\n        return BackgroundPresentationController(presentedViewController: presented, presentingViewController: presenting)\n    }\n\n    func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n\n        return TransitionAnimator(isPresenting: true)\n    }\n\n    func animationControllerForDismissedController(dismissed: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n\n        return TransitionAnimator(isPresenting: false)\n    }\n\n    func interactionControllerForPresentation(animator: UIViewControllerAnimatedTransitioning) -\u003e UIViewControllerInteractiveTransitioning? {\n        return nil\n    }\n\n    func interactionControllerForDismissal(animator: UIViewControllerAnimatedTransitioning) -\u003e UIViewControllerInteractiveTransitioning? {\n        guard let percentInteractiveTransition = percentInteractiveTransition else {\n            return nil\n        }\n        \n        return percentInteractiveTransition.isInteractiveDissmalTransition ? percentInteractiveTransition : nil\n    }\n}\n```\n\n## 3.Set InteractiveTransition to modal\nClass InteractiveTransition inherits UIPercentDrivenInteractiveTransition.\n```swift\nclass ModalViewController: UIViewController {\n    \n    var percentInteractiveTransition: InteractiveTransition?\n    \n    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {\n        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n        \n        modalPresentationStyle = .Custom\n        transitioningDelegate = self\n        \n        percentInteractiveTransition = InteractiveTransition(attachedViewController: self)\n    }\n```\n\n## 4.Define interactive animation\nYou have to define how animation change with gesture. You check [InteractiveTransition.swift](https://github.com/naoyashiga/RPModalGestureTransition/blob/master/RPModalGestureTransition/InteractiveTransition.swift).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoyashiga%2FRPModalGestureTransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoyashiga%2FRPModalGestureTransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoyashiga%2FRPModalGestureTransition/lists"}