{"id":16562295,"url":"https://github.com/d-32/dmswipecards","last_synced_at":"2025-04-09T23:21:09.397Z","repository":{"id":56907671,"uuid":"76781629","full_name":"D-32/DMSwipeCards","owner":"D-32","description":"🃏 Tinder like card interface","archived":false,"fork":false,"pushed_at":"2019-06-21T03:07:55.000Z","size":223,"stargazers_count":254,"open_issues_count":9,"forks_count":31,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T18:56:11.497Z","etag":null,"topics":["cards","generic","ios","swift","ui"],"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/D-32.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-12-18T12:30:56.000Z","updated_at":"2024-12-05T03:59:31.000Z","dependencies_parsed_at":"2022-08-20T19:50:21.043Z","dependency_job_id":null,"html_url":"https://github.com/D-32/DMSwipeCards","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D-32%2FDMSwipeCards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D-32%2FDMSwipeCards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D-32%2FDMSwipeCards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/D-32%2FDMSwipeCards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/D-32","download_url":"https://codeload.github.com/D-32/DMSwipeCards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126362,"owners_count":21051909,"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":["cards","generic","ios","swift","ui"],"created_at":"2024-10-11T20:35:37.620Z","updated_at":"2025-04-09T23:21:09.371Z","avatar_url":"https://github.com/D-32.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Version](https://img.shields.io/cocoapods/v/DMSwipeCards.svg?style=flat)](http://cocoadocs.org/docsets/DMSwipeCards)\n![License](https://img.shields.io/cocoapods/l/DMSwipeCards.svg?style=flat)\n[![twitter: @dylan36032](http://img.shields.io/badge/twitter-%40dylan36032-blue.svg?style=flat)](https://twitter.com/dylan36032)\n\n![image](screenshot_1482145004.png)\n\n## Features\n\n- Swift 3\n- Custom views for the card \u0026 overlay\n- Generic\n- Dynamically add new cards on top or on the bottom\n- Lazy view loading\n\n## Setup\n```ruby\npod 'DMSwipeCards'\n```\t\n\n## Usage\n\nFirst import the module:\n```swift\nimport DMSwipeCards\n```\t\n\nNext create an instance of a `DMSwipeCardsView`:  \n(`Element` can be your custom model, or just `String`)\n```swift\nlet swipeView = DMSwipeCardsView\u003cElement\u003e(frame: frame,\n                                          viewGenerator: viewGenerator,\n                                          overlayGenerator: overlayGenerator)\n```\t                          \nViews get loaded lazy, so you have to provide `DMSwipeCardsView` with a ViewGenerator and optionally an OverlayGenerator.\n```swift\nlet viewGenerator: (String, CGRect) -\u003e (UIView) = { (element: Element, frame: CGRect) -\u003e (UIView) in\n  // return a UIView here\n}\n\nlet overlayGenerator: (SwipeMode, CGRect) -\u003e (UIView) = { (mode: SwipeMode, frame: CGRect) -\u003e (UIView) in\n  // return a UIView here\n}\n```\n### Adding cards\n\nTo add new cards, just call the `addCards` method with an array of the previously defined `Element`:\n```swift\nswipeView.addCards([Element], onTop: true)\n```\n### Delegate\n\n`DMSwipeCardsView` has a delegate property so you can get informed when a card has been swipped. The delegate has to implement following methods:\n```swift\nfunc swipedLeft(_ object: Any)\nfunc swipedRight(_ object: Any)\nfunc cardTapped(_ object: Any)\nfunc reachedEndOfStack()\n```\nThe `object` parameter is guarenteed to have the type `Element`. Sadly generics don't work here.  \n\n\n## Example\n\nFor a nice working demo sample, please take a look the [Example](https://github.com/D-32/DMSwipeCards/tree/master/Example) project.  \nTo run the example, first run `pod install` in the `Example` directory.\n\n## Credits\nLoosly based on [TinderSimpleSwipeCards](https://github.com/cwRichardKim/TinderSimpleSwipeCards)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-32%2Fdmswipecards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-32%2Fdmswipecards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-32%2Fdmswipecards/lists"}