{"id":15037796,"url":"https://github.com/cocoatoucher/aicustomviewcontrollertransition","last_synced_at":"2025-04-09T23:40:24.494Z","repository":{"id":56900465,"uuid":"65131716","full_name":"cocoatoucher/AICustomViewControllerTransition","owner":"cocoatoucher","description":"Easy and tidy way for creating custom UIViewController transitions for iOS","archived":false,"fork":false,"pushed_at":"2017-01-29T15:49:59.000Z","size":20114,"stargazers_count":139,"open_issues_count":1,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-08T07:03:10.937Z","etag":null,"topics":["cocoapod","custom","gesture","interactive","percent-driven","presentation","presenter","swift","swift-3","tidy","transition","transitioning","uiviewcontroller","viewcontroller"],"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/cocoatoucher.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-08-07T12:20:07.000Z","updated_at":"2024-09-26T01:50:24.000Z","dependencies_parsed_at":"2022-08-21T02:20:55.064Z","dependency_job_id":null,"html_url":"https://github.com/cocoatoucher/AICustomViewControllerTransition","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoatoucher%2FAICustomViewControllerTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoatoucher%2FAICustomViewControllerTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoatoucher%2FAICustomViewControllerTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cocoatoucher%2FAICustomViewControllerTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cocoatoucher","download_url":"https://codeload.github.com/cocoatoucher/AICustomViewControllerTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131465,"owners_count":21052819,"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":["cocoapod","custom","gesture","interactive","percent-driven","presentation","presenter","swift","swift-3","tidy","transition","transitioning","uiviewcontroller","viewcontroller"],"created_at":"2024-09-24T20:35:44.571Z","updated_at":"2025-04-09T23:40:24.473Z","avatar_url":"https://github.com/cocoatoucher.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AICustomViewControllerTransition\n\nEasy and tidy way for creating custom UIViewController transitions for iOS\n\nCreate view controller transitions with no limits and without the complexity of implementing UIViewControllerAnimatedTransitioning protocol or subclassing UIPercentDrivenInteractiveTransition. You just need to use provided transitioningDelegate closure callbacks and provide your UIView animation code. \n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat\n)](https://developer.apple.com/swift)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n\n![](Readme/video.gif) ![](Readme/simple.gif) ![](Readme/pan.gif) ![](Readme/table.gif) \n\nDrag Down icon used in examples and screenshots is by IconMafia from thenounproject.com (https://thenounproject.com/search/?q=drag\u0026i=463918)\n\n##Requirements\n- iOS 8.1+\n- Xcode 8 (Use pod version 1.0.3 for Xcode 7)\n\n## Installation\n\n\u003e **Embedded frameworks require a minimum deployment target of iOS 8.1**\n\u003e\n\u003e To use with a project targeting iOS 7, or if you don't want to use CocoaPods you must include the `AICustomViewControllerTransition.swift` source file directly in your project. \n\u003e\n\n---\n\n## Usage\n\n### 1. Create a custom transitioning delegate object\n\n- SimpleTransitioningDelegate\n\nIf you don't want your transition to be interactive\n\n```swift\nlet mySimpleTransitioningDelegate = SimpleTransitioningDelegate()\n```\n\n- InteractiveTransitioningDelegate\n\nIf you want your transition to be interactive as well. Includes all the functionality of SimpleTransitioningDelegate\n\n```swift\nlet myInteractiveTransitioningDelegate = InteractiveTransitioningDelegate()\n```\n\n### 2. Assign animation closures to your transitioning delegate\n\n- transitionPresent\n\nAnimate transition for presenting your modal view controller. See SimpleTransitionViewController example in the Example project. \n\n```swift\nmySimpleTransitioningDelegate.transitionPresent = { [weak self] (fromViewController: UIViewController, toViewController: UIViewController, containerView: UIView, transitionType: TransitionType, completion: @escaping () -\u003e Void) in\n\n\tUIView.animate(withDuration: animationDuration, animations: {\n\t\t// Your custom presentation animation here\n\t\t// Use provided viewController views to animate\n\t}, completion: { (finished) in\n\t\t// Do't forget to execute completion closure\n\t\tcompletion()\n\t})\n}\n```\n\n- transitionDismiss\n\nAnimate transition for dismissing your modal view controller. See SimpleTransitionViewController example in the Example project. \n\n```swift\nmySimpleTransitioningDelegate.transitionDismiss = { [weak self] (fromViewController: UIViewController, toViewController: UIViewController, containerView: UIView, transitionType: TransitionType, completion: @escaping () -\u003e Void) in\n\n\tUIView.animate(withDuration: animationDuration, animations: {\n\t\t// Your custom dismissal animation here\n\t\t// Use provided viewController views to animate\n\t}, completion: { (finished) in\n\t\tcompletion()\n\t})\n}\n```\n\n- transitionPercentPresent\n\nAnimate percent driven interactive transition for presenting your modal view controller. See PanToViewTransitionViewController and ExpandingCellsTableViewController examples in the Example project.\n\n```swift\nmyInteractiveTransitioningDelegate.transitionPercentPresent = {[weak self] (fromViewController: UIViewController, toViewController: UIViewController, percentage: CGFloat, containerView: UIView) in\n\t// Animate your view controllers using provided percentage\n\t// Because the transition is progressive, you probably don't need an animation block here\n}\n```\n\n- transitionPercentDismiss\n\nAnimate percent driven interactive transition for dismissing your modal view controller. See PanToViewTransitionViewController and ExpandingCellsTableViewController examples in the Example project.\n\n```swift\nmyInteractiveTransitioningDelegate.transitionPercentDismiss = {[weak self] (fromViewController: UIViewController, toViewController: UIViewController, percentage: CGFloat, containerView: UIView) in\n\t// Animate your view controllers using provided percentage\n\t// Because the transition is progressive, you probably don't need an animation block here\n}\n```\n\n### 3. Begin, update and finalize a percent driven interactive transition\n\nUse below methods if you are using an InteractiveTransitioningDelegate as your transitioning delegate. See PanToViewTransitionViewController and ExpandingCellsTableViewController examples in the Example project. \n\n- beginPresenting(viewController:fromViewController:) or beginDismissing(viewController:)\n\nBegin presenting your modal view controller, usually in the callback method for a gesture recognizer that your user interacts with.\n\n```swift\nmyInteractiveTransitioningDelegate.beginPresenting(viewController:myModalViewController, fromViewController:self)\n```\n\n- update(_:)\n\nUpdate the percentage of your transition, usually in the callback method for a gesture recognizer that your user interacts with.\n\n```swift\nmyInteractiveTransitioningDelegate.update(percentage)\n```\n\n- finalizeInteractiveTransition(isTransitionCompleted:)\n\nEnd presenting or dismissing an interactive transition.\n\n```swift\nmyInteractiveTransitioningDelegate.finalizeInteractiveTransition(isTransitionCompleted:true)\n```\n\n### 4. Present your view controller as usual\n\nIf you are not presenting your view controller in an interactive way, present your view controller as usual. Even if you are using an InteractiveTransitioningDelegate you can still choose to present or dismiss your view controller automatically without a progressive interaction from user, e.g. user taps the button only once. See PanToViewTransitionViewController in Example project. \n\n```swift\nmyModalViewController.modalPresentationStyle = .Custom\nmyModalViewController.transitioningDelegate = myInteractiveTransitioningDelegate //or mySimpleTransitioningDelegate\nself.presentViewController(self.detailViewController, animated: true, completion: nil)\n```\n\n## Documentation\n\nhttp://cocoadocs.org/docsets/AICustomViewControllerTransition/\n\n## License\n\nAICustomViewControllerTransition is released under the MIT license. See LICENSE for details.\n\n\nyoutube, fancy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocoatoucher%2Faicustomviewcontrollertransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcocoatoucher%2Faicustomviewcontrollertransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocoatoucher%2Faicustomviewcontrollertransition/lists"}