{"id":2188,"url":"https://github.com/jobandtalent/CardStackController","last_synced_at":"2025-08-02T23:32:20.695Z","repository":{"id":56905659,"uuid":"75239135","full_name":"jobandtalent/CardStackController","owner":"jobandtalent","description":"iOS custom controller used in Jobandtalent app to present new view controllers as cards","archived":true,"fork":false,"pushed_at":"2019-04-03T02:59:34.000Z","size":5382,"stargazers_count":522,"open_issues_count":4,"forks_count":37,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-04-24T14:15:55.137Z","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/jobandtalent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T00:20:16.000Z","updated_at":"2024-01-17T06:36:23.000Z","dependencies_parsed_at":"2022-08-21T02:50:30.828Z","dependency_job_id":null,"html_url":"https://github.com/jobandtalent/CardStackController","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobandtalent%2FCardStackController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobandtalent%2FCardStackController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobandtalent%2FCardStackController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobandtalent%2FCardStackController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jobandtalent","download_url":"https://codeload.github.com/jobandtalent/CardStackController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503143,"owners_count":17930520,"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:07.050Z","updated_at":"2024-12-06T17:30:51.096Z","avatar_url":"https://github.com/jobandtalent.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Other free courses","Font","Other Testing"],"readme":"![](https://github.com/jobandtalent/AnimatedTextInput/blob/master/Assets/Jobandtalent%20Eng.png)\n\n# CardStackController\niOS custom controller used in the [Jobandtalent app](https://itunes.apple.com/app/id665060895) to present new view controllers as cards.\n\nThis controller behaves very similar to `UINavigationController`, maintaining a stack of ViewControllers. The presentation of new view controllers is different though. New view controllers are presented as a new “Card” in front of the current context. The next GIFs show the control in action.\n\nGif from the example project supplied:\n\n![](https://github.com/jobandtalent/CardStackController/blob/master/Assets/cards.gif?raw=true)\n\n\nGif from the Jobandtalent app:\n\n![](https://github.com/jobandtalent/CardStackController/blob/master/Assets/cards-app.gif?raw=true)\n\n\n## Installation\nUse Cocoapods to install this custom control in your project.\n\n```\npod ‘CardStackController’, '~\u003e 0.1.0’\n```\n\n## Usage\nUse the main and only public class `CardStackController` to present or stack new view controllers.\nAfter creating and configuring `CardStackController`, present it modally (it doesn’t need to be animated). Once the controller itself is presented, you can start stacking cards by calling `stack(viewController:)` method.\n\nExample of usage:\n\n```swift\ncardStackController.delegate = self\ncardStackController.cardScaleFactor = CGFloat(firstSlider.value)\ncardStackController.firstCardTopOffset = CGFloat(secondSlider.value)\ncardStackController.topOffsetBetweenCards = CGFloat(thirdSlider.value)\ncardStackController.verticalTranslation = CGFloat(fourthSlider.value)\ncardStackController.automaticallyDismiss = false\npresent(cardStackController, animated: false, completion: nil)\n\nlet root = newController()\nroot.delegate = self\ncardStackController.stack(viewController: root)\n```\n\n\nThis control is highly customisable and contains many features, among the ones we highlight:\n- The user can dismiss cards by dragging them down.\n- It is possible to tune the `damping` and `frequency` values of the presenting animation to achieve all kinds of animation curves.\n- It is possible to customise the top distance between cards, the amount each card gets resized, the size of each card… \n- There are many convenient methods to unstack cards: `unstackAll`, `unstackUntilRoot`, `unstackLast`, etc.\n\n\n## Under the hood\n`CardStackController` uses `UIKit Dynamics` to present or stack cards. It creates an attachment behaviour between a card and a fix point on the screen. To prevent the card moving sideways, there is a collision behaviour between each card and the borders of the screen. Finally, there is a DynamicItem behaviour for each card to prevent rotation (this behaviour could also be used to apply density/friction/etc to them, but we didn’t find it necessary).\n\n\n\nCardStackController 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%2Fjobandtalent%2FCardStackController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjobandtalent%2FCardStackController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobandtalent%2FCardStackController/lists"}