{"id":26505096,"url":"https://github.com/di2pra/d2pcurvedmodal","last_synced_at":"2025-10-06T14:34:00.593Z","repository":{"id":56907052,"uuid":"111249161","full_name":"di2pra/D2PCurvedModal","owner":"di2pra","description":"An elegant and curved modal View for iOS (Swift)","archived":false,"fork":false,"pushed_at":"2017-11-19T18:09:06.000Z","size":2706,"stargazers_count":59,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T13:22:24.360Z","etag":null,"topics":["circular","curve","ios","iphone","modal","swift"],"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/di2pra.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":"2017-11-18T23:49:09.000Z","updated_at":"2023-07-18T11:47:15.000Z","dependencies_parsed_at":"2022-08-21T03:20:54.404Z","dependency_job_id":null,"html_url":"https://github.com/di2pra/D2PCurvedModal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/di2pra/D2PCurvedModal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PCurvedModal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PCurvedModal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PCurvedModal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PCurvedModal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/di2pra","download_url":"https://codeload.github.com/di2pra/D2PCurvedModal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di2pra%2FD2PCurvedModal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278625128,"owners_count":26017885,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["circular","curve","ios","iphone","modal","swift"],"created_at":"2025-03-20T20:58:44.440Z","updated_at":"2025-10-06T14:34:00.557Z","avatar_url":"https://github.com/di2pra.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# D2PCurvedModal\n\n[![CI Status](http://img.shields.io/travis/di2pra/D2PCurvedModal.svg?style=flat)](https://travis-ci.org/di2pra/D2PCurvedModal)\n[![Version](https://img.shields.io/cocoapods/v/D2PCurvedModal.svg?style=flat)](http://cocoapods.org/pods/D2PCurvedModal)\n[![License](https://img.shields.io/cocoapods/l/D2PCurvedModal.svg?style=flat)](http://cocoapods.org/pods/D2PCurvedModal)\n[![Platform](https://img.shields.io/cocoapods/p/D2PCurvedModal.svg?style=flat)](http://cocoapods.org/pods/D2PCurvedModal)\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\u003cimg alt=\"Demo Gif\" src=\"https://github.com/di2pra/D2PCurvedModal/blob/master/image/D2PCurvedModal.gif\" width=\"300\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg alt=\"Screenshot 1\" src=\"https://github.com/di2pra/D2PCurvedModal/blob/master/image/screenshot_1.png\" width=\"300\"\u003e\u003c/th\u003e\n    \u003cth\u003e\u003cimg alt=\"Screenshot 2\" src=\"https://github.com/di2pra/D2PCurvedModal/blob/master/image/screenshot_2.png\" width=\"300\"\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\nThe Example project use the modal as a Color/Size Picker.\n\n## Installation\n\nD2PCurvedModal is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'D2PCurvedModal'\n```\n\n## How to Use?\n\n1) First install the Pod and import the module `D2PCurvedModal` to your file\n```Swift\nimport D2PCurvedModal\n```\n\n\n2) Instantiate `D2PCurvedModalTransition` and `D2PCurvedModalPercentDrivenTransition` inside the your presenting `ViewController`\n```Swift\nlet percentDrivenTransition = D2PCurvedModalPercentDrivenTransition()\nlet transition = D2PCurvedModalTransition()\n```\n\n\n3) For the purpose of the transition animation your presenting `ViewController` must conform the `UIViewControllerTransitioningDelegate` protocol, with these appropriate methods\n```Swift\nextension ViewController: UIViewControllerTransitioningDelegate {\n    \n    func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n       \n        if presented is D2PCurvedModal {\n            transition.opening = true\n            return transition\n        }\n        \n        return nil\n        \n    }\n    \n    func animationController(forDismissed dismissed: UIViewController) -\u003e UIViewControllerAnimatedTransitioning? {\n        \n        if dismissed is D2PCurvedModal {\n            transition.opening = false\n            return transition\n        }\n        \n        return nil\n        \n        \n    }\n    \n    func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -\u003e UIViewControllerInteractiveTransitioning? {\n        \n        return percentDrivenTransition.transitionInProgress ? percentDrivenTransition : nil\n        \n    }\n    \n}\n```\n\n\n4) Inside the action method (to open the modal) instantiate the view controllers that will appear embedded into the D2PCurvedModal and instantiate `D2PCurvedModal`, to finally use the method `setUpViewOf(viewController:)` of `D2PCurvedModal`\n```Swift\n\n@IBAction func openModal(_ sender: Any) {\n\n    let myCustomVC = MyCustomVC(nibName: \"MyCustomVC\", bundle: Bundle(for: MyCustomVC.self))\n    let modalVC = D2PCurvedModal(nibName: \"D2PCurvedModal\", bundle: Bundle(for: D2PCurvedModal.self))\n \n    modalVC.setUpViewOf(viewController: myCustomVC)\n \n    modalVC.containerHeight = 200\n    modalVC.transitioningDelegate = self\n    percentDrivenTransition.attachToViewController(viewController: modalVC)\n \n    present(modalVC, animated: true, completion: nil)\n \n}\n\n```\n\n\nThat's it! You're all set!!\n\n\n\n## Documentation\nAll of the methods and properties available for **D2PCurvedModal** are documented below.\n\n\n### Change the modal container height\n##### The `containerHeight` Property (CGFloat) (Default: 300)\nUse the `containerHeight` property of `D2PCurvedModal` to change the height of the container view.\nExample usage:\n```Swift\n modalVC.containerHeight = 200\n```\n\n\n### Change the modal background color\n##### The `bgColor` Property (UIColor) (Default: .white)\nUse the `bgColor` property of `D2PCurvedModal` to change the background color of the modal view.\nExample usage:\n```Swift\n modalVC.bgColor = .orange\n```\n\n### Change the modal title\n##### The `modalTitle` Property (String) (Default: \"\")\nUse the `modalTitle` property of `D2PCurvedModal` to change the title of the modal.\nExample usage:\n```Swift\n modalVC.modalTitle = \"Filter\"\n```\n\n### Change the modal title color\n##### The `modalTitleColor` Property (UIColor) (Default: .lightGray)\nUse the `modalTitleColor` property of `D2PCurvedModal` to change the title text color.\n\n### Change the close button background color\n##### The `closeBtnBgColor` Property (UIColor) (Default: #FD4741)\nUse the `closeBtnBgColor` property of `D2PCurvedModal` to change the background color of the modal close button.\n\n\n### Change the close button tint color\n##### The `closeBtnTintColor` Property (UIColor) (Default: .white)\nUse the `closeBtnTintColor` property of `D2PCurvedModal` to change the tint color of the modal close button.\n\n### Access the container view controller\n##### The `containerVC` Property (UIViewController)\nUse the `containerVC` property of `D2PCurvedModal` to access the view controller of the view that is embedded into the `D2PCurvedModal`.\n\n### Manually close the modal view\n##### The `close(animated: Bool, completion: (() -\u003e Void)?)` method\nUse the `close` method of `D2PCurvedModal` to manually close the modal.\n\n\n\n\n\n### Delegate\n**D2PCurvedModal** uses a delegate to receive modal change events. The delegate object must conform to the `D2PCurvedModalDelegate` protocol, which is composed of the method:\n\n- `modalWillOpen(modalVC: D2PCurvedModal)`  \nTells the delegate that the view of the specified modal view controller is about to be displayed.\n\n- `modalWillClose(modalVC: D2PCurvedModal)`  \nTells the delegate that the view of the specified modal view controller is about to be removed.\n\n## Requirements\n\nNo Requirement\n\n## Author\n\n[Di2pra](https://twitter.com/di2pra) [LinkedIn](https://www.linkedin.com/in/di2pra/)\n\n## Credits\nCredits to [Johny Vino](https://www.behance.net/johnyvino) for the UI Design inspiration. [FlatIcon](https://www.flaticon.com/) for the icons.\n\n## License\n\nD2PCurvedModal 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%2Fdi2pra%2Fd2pcurvedmodal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdi2pra%2Fd2pcurvedmodal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi2pra%2Fd2pcurvedmodal/lists"}